Always On 可用性グループを使用したOCI-ClassicからOracle Cloud InfrastructureへのSQL Serverの移行 (2020/05/21)

Always On 可用性グループを使用したOCI-ClassicからOracle Cloud InfrastructureへのSQL Serverの移行 (2020/05/21)

https://blogs.oracle.com/cloud-infrastructure/migrating-sql-server-from-oci-classic-to-oracle-cloud-infrastructure-with-always-on-availability-groups
投稿者:John Parker | Cloud Solution Architect

この移行戦略の目的は、SQL Server データベースまたは SQL Server データベースの論理グループをわずかなダウンタイムで移行できるようにすることです。
この戦略では、Microsoft SQL Server with Always On 可用性グループを使用して、
現在 Oracle Cloud Infrastructure-Classic(OCI-Classic)環境にある重要な SQL Server リソースを Oracle Cloud Infrastructure に移行します。
この同じ戦略は、他のクラウドやオンプレミスのデータセンターからも適用できます。

アーキテクチャは次の図のようになります。
この戦略の基本は、SQL Server Always On 可用性グループを使用して、
ミッションクリティカルなデータベースや大きすぎて移行に割り当てられた現在のダウンタイムに収まらないデータベースを移動させることです。
OCI-Classic リージョンと Oracle Cloud Infrastructure リージョンに存在する 2 つ以上の SQL Server データベースの間に、Always On 可用性グループを構築します。
SQL Server Always On 可用性グループは、1 つの可用性グループ内で 1 つ以上のデータベースを処理するため、
データベースのダウンタイムを最小限に抑えながら、データベースの最適な移行を容易にする論理的な方法で可用性グループを構築してください。


この戦略は、移行の5つのフェーズを使用しています。「発見」「分析」「計画」「移行」「移行後」です。

発見


発見フェーズでは、現在の環境に何が含まれているか、そしてそれがどのように構築されているかを決定します。
OPCMIGRATE ツールを使用して、OCI-Classic 環境を調べることができます。
出力レポートには、インスタンスの数とブロックボリュームが表示され、現在のネットワークトポロジの概要が表示されます。
この情報は、新しい Oracle Cloud Infrastructure テナンシーで新しい SQL Server 環境を構築するための基礎となります。

opcmigrate の詳細については、 Run Oracle Cloud Infrastructure Classic Discovery and Translation Tool to Generate Reports.を参照してください。

  1. opcmigrate discover を実行します。詳細については、「サマリと JSON 出力の生成」を参照してください。以下に例を示します。

    opcmigrate レポートを実行します。詳細は、スプレッドシートの生成を参照してください。以下に例を示します。

移行が必要なコンポーネントをすべて発見した後、次のフェーズでは現在の環境を分析します。

分析


分析フェーズでは、環境のすべての部分が特定されていることを確認します。
発見フェーズのデータを分析することで、ボトルネックを特定できます。
これらのボトルネックは、アーキテ クチャのネットワーク、コンピュート、またはストレージ レイヤにある可能性があります。
現在の環境を分析する際には、移行中にできる改善点をメモしておき、移行の受け入れ基準を考えます。

  1. OPCMIGRATEツールの出力を使って、新しいアーキテクチャを計画します。
    • OPCMIGRATEネットワーク
    • OPCMIGRATEインスタンスエクスポート
  2. アーキテクチャにおける現在のボトルネックを特定します。
    • ネットワーク
    • コンピュート
    • ストレージ
  3. 新システムの受け入れ基準の概要を決定する。

次のフェーズでは、移行の計画を立てます。

プラン


作業のほとんどは、Planフェーズで行われます。
このフェーズでは、移行チェックリストを作成し、Oracle Cloud Infrastructureで環境を作成するために必要なTerraformコードを作成し、Oracle Cloud Infrastructure環境を作成します。

  1. 移行チェックリストを作成します。DNSの変更やその他のネットワークやアプリケーションの可能性のある項目を必ず含めてください。
  2. Oracle Cloud Infrastructure環境の作成に必要なTerraformスクリプトを作成します。opcmigrate の出力を参考にしてください。
    opcmigrate generate を実行して、Terraform 設定ファイルを生成します。
    以下は、Terraform variables.tf スクリプトの例です。
    /* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
    * varibles.tf
    * This example demonstrates round robin load balancing behavior by creating two instances, a configured
    * vcn and a load balancer. The public IP of the load balancer is outputted after a successful run, curl
    * this address to see the hostname change as different instances handle the request.
    *
    * NOTE: The https listener is included for completeness but should not be expected to work,
    * it uses dummy certs.
    *
    *
    * Variables for the Terraform
    * Need to include Instance, Compartment, and User OCID's
    * Compartment - SQLMigrate ocid1.compartment.oc1..
    */
    variable "compartment_id" {
      default = "**Insert Compartment OCID**"
    }
    variable "tenancy_ocid" {
      default = "**Insert Tenancy OCID**"
    }
    variable "user_ocid" {
      default = "**Insert User OCID**"
    }
    /*
    * Secrets information
    */
    variable "fingerprint" {
      default = "**Insert Fingerprint**"
    }
    variable "private_key_path" {
      default = "**Insert Path to Private Key**.pem"
    }
     
    /*
    * Instance Hostnames
    */
    variable "hostname_1" {
      default = "Bastion1"
    }
    variable "hostname_2" {
      default = "SQLB"
    }
    variable "hostname_3" {
      default = "SQLC"
    }
    variable "hostname_4" {
      default = "SQLAD01"
    }
    /*
    * Network component name
    */
    variable "vcn_name" {
      default = "SQLVCN"
    }
    variable "vnic1_name" {
      default = "vnic1"
    }
    variable "vnic2_name" {
      default = "vnic2"
    }
    variable "subnet1_name" {
      default = "DMZ"
    }
    variable "subnet2_name" {
      default = "SQLAPPNet001"
    }
     
    /*
    * Add the Region you want to create the environment:
    * phoenix   = us-phoenix-1
    * Ashburn   = us-ashburn-1
    * London    = uk-london-1
    * Frankfurt = eu-frankfurt-1
    * Toronto   = ca-toronto-1
    */
    variable "region" {
      default = "us-ashburn-1"
    }
     
    /*
    * Virtual Machine Shapes
    * VM.Standard2.1
    * VM.Standard2.16
    * VM.Standard2.2
    * VM.Standard2.24
    * VM.Standard2.4
    * VM.Standard2.8
    */
    variable "instance_shape" {
      default = "VM.Standard2.4"
    }
    variable "sql_shape" {
      default = "VM.Standard2.8"
    }
     
    /* Current Availability Domains
    */
    variable "availability_domain1" {
      default = "AaRH:US-ASHBURN-AD-1"
    }
    variable "availability_domain2" {
      default = "AaRH:US-ASHBURN-AD-2"
    }
    variable "availability_domain3" {
      default = "AaRH:US-ASHBURN-AD-3"
    }
     
    /* Current Region Availability Domains
    */
    variable "instance_fault_domain_1" {
      default = "FAULT-DOMAIN-1"
    }
    variable "instance_fault_domain_2" {
      default = "FAULT-DOMAIN-2"
    }
    variable "instance_fault_domain_3" {
      default = "FAULT-DOMAIN-3"
    }
     
    /* Image information
    * See https://docs.us-phoenix-1.oraclecloud.com/images/
    * Oracle-provided image "Windows-Server-2016-Standard-Edition-VM-Gen2-2019.03.14-0"
    */
    /*
    /* Image information
    See https://docs.us-phoenix-1.oraclecloud.com/images/
    Oracle-provided image "Windows-Server-2016-Standard-Edition-VM-Gen2-2019.03.14-0"
    */
     
    data "oci_core_images" "windows-server-2016-standard-VM" {
      compartment_id = var.compartment_id
     
      operating_system         = "Windows"
      operating_system_version = "Server 2016 Standard"
     
      sort_by          = "TIMECREATED"
      sort_order       = "DESC"
      state            = "AVAILABLE"
     
      filter {
        name   = "display_name"
        values = ["^Windows-Server-2016-Standard-Edition-VM-Gen2-([\\.0-9-]+)$"]
        regex  = true
      }
    }
     
    /*
    * Block Volume Storage variables
    * SQL servers
    *  SQLB
    *  SQLC
    */
     
    variable "TempDBSize" {
      default = "50" // size in GBs, min: 50, max 16384
    }
    variable "LogSize" {
      default = "50" // size in GBs, min: 50, max 16384
    }
    variable "DBDataSize" {
      default = "100" // size in GBs, min: 50, max 16384
    }

  3. Oracle Cloud Infrastructure環境でネットワークとコンピュートリソースを作成します。
    1. 新しいVCN、適切なサブネット、セキュリティリストを構築します。次の例は、Terraform network.tf スクリプトの例です。
      /* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
       * network.tf
       * This example demonstrates round robin load balancing behavior by creating two instances, a configured
       * vcn and a load balancer. The public IP of the load balancer is outputted after a successful run, curl
       * this address to see the hostname change as different instances handle the request.
       *
       * NOTE: The https listener is included for completeness but should not be expected to work,
       * it uses dummy certs.
       */
       
      provider "oci" {
        version          = ">= 3.0"
        tenancy_ocid     = var.tenancy_ocid
        user_ocid        = var.user_ocid
        fingerprint      = var.fingerprint
        private_key_path = var.private_key_path
        region           = var.region
      }
       
      /* Network
      */
       
      resource "oci_core_virtual_network" "vcn1" {
        cidr_block     = "10.10.10.0/24"
        compartment_id = var.compartment_id
        display_name   = var.vcn_name
        dns_label      = var.vcn_name
      }
       
      resource "oci_core_subnet" "subnet1" {
        #availability_domain = var.availability_domain1
        cidr_block          = "10.10.10.32/27"
        display_name        = var.subnet1_name
        dns_label           = var.subnet1_name
        security_list_ids   = [oci_core_security_list.securitylist1.id]
        compartment_id      = var.compartment_id
        vcn_id              = oci_core_virtual_network.vcn1.id
        route_table_id      = oci_core_route_table.routetable1.id
        dhcp_options_id     = oci_core_virtual_network.vcn1.default_dhcp_options_id
       
        provisioner "local-exec" {
          command = "sleep 5"
        }
      }
       
      resource "oci_core_subnet" "subnet2" {
        #availability_domain = var.availability_domain2
        cidr_block          = "10.10.10.64/27"
        display_name        = var.subnet2_name
        dns_label           = var.subnet2_name
        security_list_ids   = [oci_core_security_list.securitylist2.id]
        compartment_id      = var.compartment_id
        vcn_id              = oci_core_virtual_network.vcn1.id
        route_table_id      = oci_core_route_table.routetable1.id
        dhcp_options_id     = oci_core_virtual_network.vcn1.default_dhcp_options_id
       
        provisioner "local-exec" {
          command = "sleep 5"
        }
      }
       
      resource "oci_core_internet_gateway" "internetgateway1" {
        compartment_id = var.compartment_id
        display_name   = "internetgateway1"
        vcn_id         = oci_core_virtual_network.vcn1.id
      }
       
      resource "oci_core_route_table" "routetable1" {
        compartment_id = var.compartment_id
        vcn_id         = oci_core_virtual_network.vcn1.id
        display_name   = "routetable1"
       
        route_rules {
          destination       = "0.0.0.0/0"
          destination_type  = "CIDR_BLOCK"
          network_entity_id = oci_core_internet_gateway.internetgateway1.id
        }
      }
       
      resource "oci_core_security_list" "securitylist1" {
        display_name   = "public"
        compartment_id = oci_core_virtual_network.vcn1.compartment_id
        vcn_id         = oci_core_virtual_network.vcn1.id
       
        egress_security_rules {
          protocol    = "all"
          destination = "0.0.0.0/0"
        }
       
        ingress_security_rules {
          protocol = "6"
          source   = "0.0.0.0/0"
       
          tcp_options {
            min = 80
            max = 80
          }
        }
       
        ingress_security_rules {
          protocol = "6"
          source   = "0.0.0.0/0"
          tcp_options {
            min = 3389
            max = 3389
          }
        }
       
      }
       
      resource "oci_core_security_list" "securitylist2" {
        display_name   = "private"
        compartment_id = oci_core_virtual_network.vcn1.compartment_id
        vcn_id         = oci_core_virtual_network.vcn1.id
       
        egress_security_rules {
          protocol    = "all"
          destination = "0.0.0.0/0"
        }
       
        ingress_security_rules {
          protocol = "6"
          source   = "0.0.0.0/0"
          tcp_options {
            min = 3389
            max = 3389
          }
        }
      }
    2. コンピュートリソースを構築します。以下はTerraformのcompute.tfスクリプトの例です。
      /* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
       * compute.tf
       * This example demonstrates round robin load balancing behavior by creating two instances, a configured
       * vcn and a load balancer. The public IP of the load balancer is outputted after a successful run, curl
       * this address to see the hostname change as different instances handle the request.
       *
       * NOTE: The https listener is included for completeness but should not be expected to work,
       * it uses dummy certs.
       */
      /*
      * provider "oci" {
      *  version          = ">= 3.0"
      *  tenancy_ocid     = var.tenancy_ocid
      *  user_ocid        = var.user_ocid
      *  fingerprint      = var.fingerprint
      *  private_key_path = var.private_key_path
      *  region           = var.region
      * }
      */
      /*
      * Instance Creation
      */
      resource "oci_core_instance" "Bastion" {
         availability_domain = var.availability_domain1
         fault_domain        = var.instance_fault_domain_1
         compartment_id      = var.compartment_id
         display_name        = var.hostname_1
         shape               = var.instance_shape
         subnet_id           = oci_core_subnet.subnet1.id
         hostname_label      = var.hostname_1
       
      metadata = {
       user_data = base64encode(file("/Users/jsparker/Code/SQLMigration/ActiveDirectory/opcuser.ps1"))
      }
       
      source_details {
       source_id  = data.oci_core_images.windows-server-2016-standard-VM.images[0].id
       source_type = "image"
      }
       
      lifecycle {
        ignore_changes = [
         source_details[0].source_id,
        ]
       }
      }
       
      resource "oci_core_instance" "SQLB"
       availability_domain = var.availability_domain2
       fault_domain        = var.instance_fault_domain_2>
       compartment_id      = var.compartment_id
       display_name        = var.hostname_2
       shape               = var.sql_shape
       subnet_id           = oci_core_subnet.subnet2.id
       hostname_label      = var.hostname_2
       
      metadata = {
       user_data = base64encode(file("/Users/jsparker/Code/SQLMigration/ActiveDirectory/opcuser.ps1"))
      }
       
      source_details {
       source_id  = data.oci_core_images.windows-server-2016-standard-VM.images[0].id
       source_type = "image"
      }
       
      lifecycle {
       ignore_changes = [
        source_details[0].source_id,
        ]
       }
      }
       
      resource "oci_core_instance" "instance3" {
       availability_domain = var.availability_domain3
       fault_domain        = var.instance_fault_domain_3
       compartment_id      = var.compartment_id
       display_name        = var.hostname_3
       shape               = var.sql_shape
       subnet_id           = oci_core_subnet.subnet2.id
       hostname_label      = var.hostname_3
       
      metadata = {
       user_data = base64encode(file("/Users/jsparker/Code/SQLMigration/ActiveDirectory/opcuser.ps1"))
      }
       
      source_details {
       source_id = data.oci_core_images.windows-server-2016-standard-VM.images[0].id
       source_type = "image"
      }
       
      lifecycle {
       ignore_changes = [
        source_details[0].source_id,
        ]
       }
      }
      resource "oci_core_instance" "SQLAD01" {
       availability_domain = var.availability_domain3
       fault_domain        = var.instance_fault_domain_3
       compartment_id      = var.compartment_id
       display_name        = var.hostname_4
       shape               = var.instance_shape
       subnet_id           = oci_core_subnet.subnet2.id
       hostname_label      = var.hostname_4
       
      metadata = {
       user_data = base64encode(file("/Users/jsparker/Code/SQLMigration/ActiveDirectory/ActiveDirectoryInit.ps1"))
      }
       
      source_details {
       source_type = "image"
       source_id   = var.instance_image_ocid[var.region]
       }
      }
       
      <file location=""><file location=""><file location=""><file location="">
      </file></file></file></file>
  4. 新しいActive Directoryドメインサーバーを作成します。
    このソリューションでは、Active Directory ドメインコントローラを冗長化する必要はありませんが、冗長化することをお勧めします。
    以下は、PowerShell ActiveDirectoryInit.ps1 スクリプトの例です。
    #ps1_sysnative
    ########
    # Title: ActiveDirectoryInit.ps1
    # Version & Date: v1 31 Oct 2018
    #                 v1.2 3 Apr 2020
    # Creator: john.s.parker@oracle.com
    # Version 1.2 note:
    # This version is designed for a quick build of a single AD Controller. If you need more than 1 AD
    # controller then you should
    # see the original whitepaper that describes building an Active Directory Domain in OCI.DESCRIPTION
    #
    #
    # Warning: This script is a representation of how to use PowerShell to create an Active Directory Domain controller
    #          and build the first DC in a new Active Directory Forest. This script creates and uses the domain administrator account
    #          there are potential for mistakes and destructive actions. USE AT YOUR OWN RISK!!
    # This is the first script in the Active Directory Series that will establish the first
    # Active Directory Domain Controller. This script will unlock the local administrator account
    # this account will become the Domain Administrator.
    #
    # This script will install the required Windows features that are required for Active
    # Directory. This script will install the prerequisites for Active Directory, then create a
    # one-time executed script on the login after the reboot. This script will reboot the host
    # a total of 2 times to add the windows features, create the forest, and promote the domain controller.
    #
    # Variables for this script
    # $password - this is the password necessary to unlock the administrator account
    #           - and is used in both runs of the AD build.
    # $FullDomainName - the full name for the AD Domain example: CESA.corp
    # $ShortDomainName - the short name for the AD Domain example: CESA
    # $encrypted - you must encrypt the password so that you can use it as you set up your domain controller
    # $addsmodule02 - this is the text block that will be used to create the RunOnceScript that will finish the installation
    #               - of the domain controller.
    # $RunOnceKey - this is the key that will create the command to complete the installation of the domain controller.
    Try {
    #
    # Start the logging in the C:\DoimainJoin directory
    #
    Start-Transcript -Path "C:\DomainJoin\stage1.txt"
    # Global Variables
    $password="P@ssw0rd123!!"
    # Set the Administrator Password and activate the Domain Admin Account
    #
    net user Administrator $password /logonpasswordchg:no /active:yes /Expires:Never
    # Install the Windows features necessary for Active Directory
    # Features
    #   - .NET Core
    #   - Active Directory Domain Services
    #   - Remote Active Directory Services
    #   - DNS Services
    #
    Install-WindowsFeature NET-Framework-Core
    Install-WindowsFeature AD-Domain-Services
    Install-WindowsFeature RSAT-ADDS
    Install-WindowsFeature RSAT-DNS-Server
    # Create text block for the new script that will be ran once on reboot
    #
    $addsmodule02 = @"
    #ps1_sysnative
    Try {
    Start-Transcript -Path C:\DomainJoin\stage2.txt
    `$password = "P@ssw0rd123!!"
    `$FullDomainName = "<>.corp"
    `$ShortDomainName = "<>"
    `$encrypted = ConvertTo-SecureString `$password -AsPlainText -Force
    Import-Module ADDSDeployment
    Install-ADDSForest ``
    -CreateDnsDelegation:`$false ``
    -DatabasePath "C:\Windows\NTDS" ``
    -DomainMode "WinThreshold" ``
    -DomainName `$FullDomainName ``
    -DomainNetbiosName `$ShortDomainName ``
    -ForestMode "WinThreshold" ``
    -InstallDns:`$true ``
    -LogPath "C:\Windows\NTDS" ``
    -NoRebootOnCompletion:`$false ``
    -SysvolPath "C:\Windows\SYSVOL" ``
    -SafeModeAdministratorPassword `$encrypted ``
    -Force:`$true
    } Catch {
    Write-Host $_
    } Finally {
    Stop-Transcript
    }
    "@
    Add-Content -Path "C:\DomainJoin\ADDCmodule2.ps1" -Value $addsmodule02
    # Adding the run once job
    #
    $RunOnceKey = "HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce"
    set-itemproperty $RunOnceKey "NextRun" ('C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe -executionPolicy Unrestricted -File ' + "C:\DomainJoin\ADDCmodule2.ps1")
    # End the logging
    #
    } Catch {
    Write-Host $_
    } Finally {
    Stop-Transcript
    }
    # Last step is to reboot the local host
    #
    Restart-Computer -ComputerName "localhost" -Force
  5. Oracle Cloud Infrastructure リージョンに SQL Server 環境を作成します。
  6. すべてのSQL ServerホストをActive Directoryドメインに結合します。
    • 以下は、PowerShell AddComputer.ps1 スクリプトの例です。
      #ps1_sysnative
      ########
      # Title: AddComputer.ps1
      # Version & Date: v1 31 Oct 2018
      # Creator: lawrence.gabriel@oracle.com & john.s.parker@oracle.com
      # Warning: This script is a representation of how to use PowerShell to create an Active Directory Domain controller
      #          and build the first DC in a new Active Directory Forest. This script creates and uses the domain administrator account
      #          there are potential for mistakes and destructive actions. USE AT YOUR OWN RISK!!
      # This is the third script in the Active Directory Series that will join a computer to your new Active Directory Domain. This script
      # will create the computer account to the Active Directory Domain. You will need to use an account that has the Add Computer domain
      # role.
      # Source:
      # From https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/add-computer?view=powershell-5.1#examples
      # Variables for this script
      # $NewComputerName - this is the name of the new computer that you want to add to your domain
      #
      ## Run as Administrator on a domain computer.
      $NewComputerName = "SQLB"
      New-ADComputer -Name $NewComputerName -AccountPassword (ConvertTo-SecureString -String 'TempJoinPA$$' -AsPlainText -Force)
    • 以下はPowerShellのNewcomputer.ps1スクリプトの例です。
      #ps1_sysnative
      ########
      # Title: newcomputer.ps1
      # Version & Date: v1 31 Oct 2018
      #               : v1.2 3 Apr 2020
      # 1.2 note: This has been modified for migrating a SQL Server to OCI
      #
      # Creator: lawrence.gabriel@oracle.com & john.s.parker@oracle.com
      # Warning: This script is a representation of how to use PowerShell to create an Active Directory Domain controller
      #          and build the first DC in a new Active Directory Forest. This script creates and uses the domain administrator account
      #          there are potential for mistakes and destructive actions. USE AT YOUR OWN RISK!!
      # This is the forth script in the Active Directory Series that will join a computer to your new Active Directory Domain. This script
      # will join the newly created host to an Active Directory Domain.
      #
      # Variables for this script
      # $DnsServer - this is the private IP address of the Primary Domain Controller
      # $DnsServer2 - this is the private IP address of the Secondary Domain Controller
      # $DomaintoJoin - this is the full name of the domain you want to join.
      # $JoinCred - this will be the encrypted credential
      #
      Try {
      Start-Transcript -Path "C:\DomainJoin\Stage4.txt" -Force
      $DnsServer = 'IP of Domian Controller'
      $DnsServer2 = 'IP of Domain Controller'
      $DomainToJoin = 'CMGSOL.corp'
      #######
      # Sets the DNS to the DC.
      #######
      Set-DnsClientServerAddress -InterfaceAlias Ethernet -ServerAddresses ($DnsServer, $DnsServer2)
      #######
      # Build the one time use password
      #######
      $JoinCred = New-Object pscredential -ArgumentList ([pscustomobject]@{
          UserName = $null
          Password = (ConvertTo-SecureString -String 'TempJoinPA$$' -AsPlainText -Force)[0]
      })
      Add-Computer -Domain $DomainToJoin -Options UnsecuredJoin,PasswordPass -Credential $JoinCred
      } Catch {
      Write-Host $_
      } Finally {
      Stop-Transcript
      }
      #######
      #
      # This wait is to ensure that the Add-Computer command finishes before the restart.
      #
      #######
      start-sleep -s 300
      Restart-Computer -ComputerName "localhost" -Force
  7. 新しいインスタンスのメトリクスと監視が適切に行われていることを確認します。
  8. 現在の OCI-Classic 環境と新しい Oracle Cloud Infrastructure VCN 間に VPN 接続を作成します。
  9. SQL Server セットアップ手順を使用して、OCI-Classic SQL Server(プライマリ)と新しい Oracle Cloud Infrastructure SQL Server(ターゲット)の間に SQL エンドポイントを確立します。
    可用性グループ内のすべてのデータベースについて、 この手順を実行します。
    この例では、Oracle Cloud Infrastructure Object Storage に移動した Microsoft SQL Server 2016 バイナリを使用して構築しました。
    次に、新たに作成した SQL Server ホストにマウントするための事前承認リクエスト(PAR)を作成しました。
    バイナリのインストールは、SQL Server を作成し、Always On 可用性グループの構築を追加するための Microsoft のドキュメントに従いました。
  10. データベースを可用性グループに追加します。
    手順については、「Add a Database to an Always On availability group」を参照してください。
  11. レプリカを追加します。
    手順については、「Add a replica to your Always On Availability group using the Availability Group Wizard in SQL Server Management.」を参照してください。
  12. 移行チェックリストを完了します。以下にチェックリストのサンプルを示します。
    移行する環境によっては、チェックリストをより詳細にすることができます。
    • アプリケーションを特定
    • ターゲットネットワークを作成
    • すべてのホストが作成
      • 複数のレプリカを作成する場合は、ターゲット SQL サーバー SQLB または SQLC を作成
      • 必要に応じて、新しいActive Directoryドメインコントローラを作成
    • すべてのホストが Active Directory ドメインに参加します。
      • プライマリ SQL サーバー SQLA
      • レプリカSQLサーバーSQLB
    • SQL Server の可用性グループが構築され、SQLA と SQLB の間でデータベースが同期されています。
    • すべてのアプリケーションとデータベースのクライアントが特定され、フェイルオーバー後の再接続を確実に行うための計画が構築されます。
    • フェイルオーバーコマンドが特定されます。
    • フェイルオーバーの受け入れ基準が決定されます。
      • 新しいクライアントがSQLBに接続できるようになります。
      • アプリケーションが所定の方法で動作します。
    • ターゲット SQL Server が動作している。

Oracle Cloud Infrastructure環境を計画・構築したら、次は実際にSQL Server環境を移行するフェーズです。

移行


移行フェーズは簡単です。開発した移行チェックリストに従って、クライアント アクティビティを SQLA から SQLB に移動します。

  1. 同期プロセスを監視し、ターゲット データベースがプライマリ データベースと同期していることを確認します。
    詳細については、Perform a planned manual failover of an Always On availability group (SQL Server)を参照してください。
  2. 以下のいずれかの方法を使用して、手動フェイルオーバーを実行します。
      1. オブジェクトエクスプローラで、[Always On High Availability]をデプロイし、[Availability Groups]をデプロイ
      2. フェイルオーバーする可用性グループを右クリックして、フェイルオーバーを選択
      3. ウィザードのプロンプトに従います。

SQL Server Management Studio

SQLを実行します。可用性グループ DBGRP1 フェイルオーバーを変更します。

  1. スケジュールされた時間にデータベースをフェイルオーバーします。
    1. SQL コマンドを使用して、ターゲットおよびプライマリ データベース グループを切り替えます。
    2. SQLA のすべてのクライアント アクセスがオフになっていることを確認します。
    3. SQL ServerクラスタIPアドレスを新しいSQL ServerロケーションSQLBと一致するように更新します。
    4. クライアントを新しい SQL Server にフェイルオーバーするか、クライアントにクラスタ名を使用して、クライアントが正しい SQL Server を指していることを確認します。
    5. トラフィックを監視して、すべてのトランザクションが正しく動作していることを確認します。
  2. フェイルオーバーを確認

Oracle Cloud Infrastructure への移行が完了しました。
最終段階では、 OCI-Classic 環境をデコミッショニングします。

移行後


移行後のフェーズでは、OCI-Classic 環境を経由して、不要になったサービスや監視をシャットダウンします。
Discover through Migrate フェーズで発見されなかった未知のクライアントやアプリケーションが影響を受けないように、古い環境を完全に破壊する前にしばらく待つことがあります。

  • オプションとして、別のSQL Serverをアベイラビリティグループに追加して、可用性グループを拡張して高可用性を確保することもできます。
    可用性ドメイン2のSQLCについては、図Aを参照してください。
  • SQLAとSQLBの間の可用性グループを無効にします。
  • OCI-Classic SQL Server SQLAをデコミッションします。

移行を成功させるとは、すべてのアプリケーション、コンピュート、ストレージ、およびネットワークリソースが
発見され、分析され、計画され、Oracle Cloud Infrastructureに移行されることを確認するプロセスです。

参考情報

コメント

このブログの人気の投稿

Oracle RACによるメンテナンスのためのドレインとアプリケーション・コンティニュイティの仕組み (2023/11/01)

Oracle Cloud Infrastructure Secure Desktopsを発表: デスクトップ仮想化のためのOracleのクラウドネイティブ・サービス (2023/06/28)

新しいOracle Container Engine for Kubernetesの機能強化により、大規模なKubernetesがさらに簡単になりました (2023/03/20)