在 Azure Linux 虛擬機器上設定 Oracle ASMSet up Oracle ASM on an Azure Linux virtual machine

Azure 虛擬機器提供完全可設定且彈性的計算環境。Azure virtual machines provide a fully configurable and flexible computing environment. 本教學課程涵蓋基本的 Azure 虛擬機器部署,並結合 Oracle 自動儲存體管理 (ASM) 的安裝和設定。This tutorial covers basic Azure virtual machine deployment combined with the installation and configuration of Oracle Automated Storage Management (ASM). 您會了解如何:You learn how to:

  • 建立和連線至 Oracle 資料庫 VMCreate and connect to an Oracle Database VM
  • 安裝和設定 Oracle 自動儲存體管理Install and configure Oracle Automated Storage Management
  • 安裝和設定 Oracle Grid InfrastructureInstall and configure Oracle Grid infrastructure
  • 初始化 Oracle ASM 安裝Initialize an Oracle ASM installation
  • 建立受 ASM 管理的 Oracle DBCreate an Oracle DB managed by ASM

如果您選擇在本機安裝和使用 CLI,本教學課程會要求您執行 Azure CLI 2.0.4 版或更新版本。If you choose to install and use the CLI locally, this tutorial requires that you are running the Azure CLI version 2.0.4 or later. 執行 az --version 以尋找版本。Run az --version to find the version. 如果您需要安裝或升級,請參閱安裝 Azure CLIIf you need to install or upgrade, see Install Azure CLI.

準備環境Prepare the environment

建立資源群組Create a resource group

若要建立資源群組,請使用 az group create 命令。To create a resource group, use the az group create command. Azure 資源群組是在其中部署與管理 Azure 資源的邏輯容器。An Azure resource group is a logical container in which Azure resources are deployed and managed. 在此範例中,系統會在 eastus 區域中建立名為 myResourceGroup 的資源群組。In this example, a resource group named myResourceGroup in the eastus region.

az group create --name myResourceGroup --location eastus

建立 VMCreate a VM

若要建立以 Oracle 資料庫映像為基礎的虛擬機器,並將其設定為使用 Oracle ASM,請使用 az vm create 命令。To create a virtual machine based on the Oracle Database image and configure it to use Oracle ASM, use the az vm create command.

下列範例會建立名為 myVM 的 VM,其大小為 Standard_DS2_v2,並附加四個容量各 50 GB 的資料磁碟。The following example creates a VM named myVM that is a Standard_DS2_v2 size with four attached data disks of 50 GB each. 如果預設的金鑰位置還沒有 SSH 金鑰的話,此範例也會建立這些金鑰。If they do not already exist in the default key location, it also creates SSH keys. 若要使用一組特定金鑰,請使用 --ssh-key-value 選項。To use a specific set of keys, use the --ssh-key-value option.

az vm create --resource-group myResourceGroup \
 --name myVM \
 --image Oracle:Oracle-Database-Ee:12.1.0.2:latest \
 --size Standard_DS2_v2 \
 --generate-ssh-keys \
 --data-disk-sizes-gb 50 50 50 50

在您建立 VM 後,Azure CLI 會顯示類似下列範例的資訊。After you create the VM, Azure CLI displays information similar to the following example. 請記下 publicIpAddress 的值。Note the value for publicIpAddress. 您必須使用此位址來存取 VM。You use this address to access the VM.

{
  "fqdns": "",
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "eastus",
  "macAddress": "00-0D-3A-36-2F-56",
  "powerState": "VM running",
  "privateIpAddress": "10.0.0.4",
  "publicIpAddress": "13.64.104.241",
  "resourceGroup": "myResourceGroup"
}

連接至 VMConnect to the VM

若要對 VM 建立 SSH 工作階段並進行其他設定,請使用下列命令。To create an SSH session with the VM and configure additional settings, use the following command. 以 VM 的 publicIpAddress 值取代 IP 位址。Replace the IP address with the publicIpAddress value for your VM.

ssh <publicIpAddress>

安裝 Oracle ASMInstall Oracle ASM

若要安裝 Oracle ASM,請完成下列步驟。To install Oracle ASM, complete the following steps.

如需關於安裝 Oracle ASM 的詳細資訊,請參閱 Oracle ASMLib Downloads for Oracle Linux 6For more information about installing Oracle ASM, see Oracle ASMLib Downloads for Oracle Linux 6.

  1. 您必須以根使用者身分登入才能繼續安裝 ASM:You need to login as root in order to continue with ASM installation:

    sudo su -
    
  2. 執行這些其他命令以安裝 Oracle ASM 元件:Run these additional commands to install Oracle ASM components:

     yum list | grep oracleasm 
     yum -y install kmod-oracleasm.x86_64 
     yum -y install oracleasm-support.x86_64 
     wget https://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.12-1.el6.x86_64.rpm 
     yum -y install oracleasmlib-2.0.12-1.el6.x86_64.rpm 
     rm -f oracleasmlib-2.0.12-1.el6.x86_64.rpm
    
  3. 確認您已安裝 Oracle ASM:Verify that Oracle ASM is installed:

    rpm -qa |grep oracleasm
    

    此命令的輸出會列出下列元件:The output of this command should list the following components:

    oracleasm-support-2.1.10-4.el6.x86_64
    kmod-oracleasm-2.0.8-15.el6_9.x86_64
    oracleasmlib-2.0.12-1.el6.x86_64
    
  4. ASM 需要特定的使用者和角色才能正常運作。ASM requires specific users and roles in order to function correctly. 下列命令會建立必要的使用者帳戶和群組:The following commands create the pre-requisite user accounts and groups:

     groupadd -g 54345 asmadmin 
     groupadd -g 54346 asmdba 
     groupadd -g 54347 asmoper 
     useradd -u 3000 -g oinstall -G dba,asmadmin,asmdba,asmoper grid 
     usermod -g oinstall -G dba,asmdba,asmadmin oracle
    
  5. 確認已正確建立使用者和群組:Verify users and groups were created correctly:

    id grid
    

    此命令的輸出會列出下列使用者和群組:The output of this command should list the following users and groups:

    uid=3000(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54345(asmadmin),54346(asmdba),54347(asmoper)
    
  6. 為使用者 grid 建立資料夾,並變更擁有者:Create a folder for user grid and change the owner:

    mkdir /u01/app/grid 
    chown grid:oinstall /u01/app/grid
    

設定 Oracle ASMSet up Oracle ASM

在此教學課程中,預設使用者是「grid」,預設群組是「asmadmin」。For this tutorial, the default user is grid and the default group is asmadmin. 確定「oracle」使用者屬於 asmadmin 群組。Ensure that the oracle user is part of the asmadmin group. 若要設定 Oracle ASM 的安裝,請完成下列步驟︰To set up your Oracle ASM installation, complete the following steps:

  1. 設定 Oracle ASM 程式庫的驅動程式包含定義預設使用者 (grid) 和預設群組 (asmadmin),以及設定在開機時啟動磁碟機 (選擇 y) 並在開機時掃描磁碟 (選擇 y)。Setting up the Oracle ASM library driver involves defining the default user (grid) and default group (asmadmin) as well as configuring the drive to start on boot (choose y) and to scan for disks on boot (choose y). 您必須回答下列命令中的提示:You need to answer the prompts from the following command:

    /usr/sbin/oracleasm configure -i
    

    此命令的輸出應類似下列結果,並停止於要回答的提示。The output of this command should look similar to the following, stopping with prompts to be answered.

    Configuring the Oracle ASM library driver.
    
    This will configure the on-boot properties of the Oracle ASM library
    driver. The following questions will determine whether the driver is
    loaded on boot and what permissions it will have. The current values
    will be shown in brackets ('[]'). Hitting <ENTER> without typing an
    answer will keep that current value. Ctrl-C will abort.
    
    Default user to own the driver interface []: grid
    Default group to own the driver interface []: asmadmin
    Start Oracle ASM library driver on boot (y/n) [n]: y
    Scan for Oracle ASM disks on boot (y/n) [y]: y
    Writing Oracle ASM library driver configuration: done
    
  2. 檢視磁碟組態︰View the disk configuration:

    cat /proc/partitions
    

    此命令的輸出應類似下列可用磁碟清單The output of this command should look similar to the following listing of available disks

    8       16   14680064 sdb
    8       17   14678976 sdb1
    8        0   52428800 sda
    8        1     512000 sda1
    8        2   51915776 sda2
    8       48   52428800 sdd
    8       64   52428800 sde
    8       80   52428800 sdf
    8       32   52428800 sdc
    11       0       1152 sr0
    
  3. 透過執行下列命令格式化磁碟 /dev/sdc,並透過下列項目回答提示:Format disk /dev/sdc by running the following command and answering the prompts with:

    • n 適用於新的磁碟分割n for new partition
    • p 為主要磁碟分割p for primary partition
    • 1 以選取第一個磁碟分割1 to select the first partition
    • enter 為預設第一個磁柱press enter for the default first cylinder
    • enter 為預設最後一個磁柱press enter for the default last cylinder
    • w 將變更寫入磁碟分割表格Azure Resource Managerpress w to write the changes to the partition table
    fdisk /dev/sdc
    

    使用上述提供的答案,fdisk 命令的輸出應該如下所示:Using the answers provided above, the output for the fdisk command should look like the following:

    Device contains not a valid DOS partition table, or Sun, SGI or OSF disklabel
    Building a new DOS disklabel with disk identifier 0xf865c6ca.
    Changes will remain in memory only, until you decide to write them.
    After that, of course, the previous content won't be recoverable.
    
    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
    
    The device presents a logical sector size that is smaller than
    the physical sector size. Aligning to a physical sector (or optimal
    I/O) size boundary is recommended, or performance may be impacted.
    
    WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
            switch off the mode (command 'c') and change display units to
            sectors (command 'u').
    
    Command (m for help): n
    Command action
      e   extended
      p   primary partition (1-4)
    p
    Partition number (1-4): 1
    First cylinder (1-6527, default 1):
    Using default value 1
    Last cylinder, +cylinders or +size{K,M,G} (1-6527, default 6527):
    Using default value 6527
    
    Command (m for help): w
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    Syncing disks.
    
  4. 針對 [/dev/sdd]、[/dev/sde] 和 [/dev/sdf] 重複上述 fdisk 命令。Repeat the preceding fdisk command for /dev/sdd, /dev/sde, and /dev/sdf.

  5. 檢查磁碟組態︰Check the disk configuration:

    cat /proc/partitions
    

    此命令的輸出如下所示:The output of the command should look like the following:

    major minor  #blocks  name
    
      8       16   14680064 sdb
      8       17   14678976 sdb1
      8       32   52428800 sdc
      8       33   52428096 sdc1
      8       48   52428800 sdd
      8       49   52428096 sdd1
      8       64   52428800 sde
      8       65   52428096 sde1
      8       80   52428800 sdf
      8       81   52428096 sdf1
      8        0   52428800 sda
      8        1     512000 sda1
      8        2   51915776 sda2
      11       0    1048575 sr0
    
  6. 檢查 Oracle ASM 服務狀態,並啟動 Oracle ASM 服務:Check the Oracle ASM service status and start the Oracle ASM service:

    service oracleasm status 
    service oracleasm start
    

    此命令的輸出如下所示:The output of the command should look like the following:

    Checking if ASM is loaded: no
    Checking if /dev/oracleasm is mounted: no
    Initializing the Oracle ASMLib driver:                     [  OK  ]
    Scanning the system for Oracle ASMLib disks:               [  OK  ]
    
  7. 建立 Oracle ASM 磁碟︰Create Oracle ASM disks:

    service oracleasm createdisk ASMSP /dev/sdc1 
    service oracleasm createdisk DATA /dev/sdd1 
    service oracleasm createdisk DATA1 /dev/sde1 
    service oracleasm createdisk FRA /dev/sdf1
    

    此命令的輸出如下所示:The output of the command should look like the following:

    Marking disk "ASMSP" as an ASM disk:                       [  OK  ]
    Marking disk "DATA" as an ASM disk:                        [  OK  ]
    Marking disk "DATA1" as an ASM disk:                       [  OK  ]
    Marking disk "FRA" as an ASM disk:                         [  OK  ]
    
  8. 列出 Oracle ASM 磁碟︰List Oracle ASM disks:

    service oracleasm listdisks
    

    此命令的輸出會列出下列 Oracle ASM 磁碟:The output of the command should list off the following Oracle ASM disks:

     ASMSP
     DATA
     DATA1
     FRA
    
  9. 變更 Root、Oracle 和 Grid 使用者的密碼。Change the passwords for the root, oracle, and grid users. 由於您稍後會在安裝期間使用這些新密碼,因此請將其記下Make note of these new passwords as you are using them later during the installation.

    passwd oracle 
    passwd grid 
    passwd root
    
  10. 變更資料夾權限︰Change the folder permission:

    chmod -R 775 /opt 
    chown grid:oinstall /opt 
    chown oracle:oinstall /dev/sdc1 
    chown oracle:oinstall /dev/sdd1 
    chown oracle:oinstall /dev/sde1 
    chown oracle:oinstall /dev/sdf1 
    chmod 600 /dev/sdc1 
    chmod 600 /dev/sdd1 
    chmod 600 /dev/sde1 
    chmod 600 /dev/sdf1
    

下載並準備 Oracle Grid InfrastructureDownload and prepare Oracle Grid Infrastructure

若要下載並準備 Oracle Grid Infrastructure 軟體,請完成下列步驟︰To download and prepare the Oracle Grid Infrastructure software, complete the following steps:

  1. Oracle ASM 下載頁面下載 Oracle Grid Infrastructure。Download Oracle Grid Infrastructure from the Oracle ASM download page.

    Oracle Database 12c Release 1 Grid Infrastructure (12.1.0.2.0) for Linux x86-64 下載標題底下,下載兩個 .zip 檔案。Under the download titled Oracle Database 12c Release 1 Grid Infrastructure (12.1.0.2.0) for Linux x86-64, download the two .zip files.

  2. 將 .zip 檔下載到用戶端電腦之後,您可以使用「安全複製通訊協定 (SCP)」,將這些檔案複製到 VM:After you download the .zip files to your client computer, you can use Secure Copy Protocol (SCP) to copy the files to your VM:

    scp *.zip <publicIpAddress>:.
    
  3. 透過 SSH 連接回 Oracle VM,以將 .zip 檔案移至 /opt 資料夾。SSH back into your Oracle VM in Azure in order to move the .zip files into the /opt folder. 接著,變更檔案的擁有者︰Then, change the owner of the files:

    ssh <publicIPAddress>
    sudo mv ./*.zip /opt
    cd /opt
    sudo chown grid:oinstall linuxamd64_12102_grid_1of2.zip
    sudo chown grid:oinstall linuxamd64_12102_grid_2of2.zip
    
  4. 將檔案解壓縮。Unzip the files. (如果您尚未安裝 Linux 解壓縮工具,請加以安裝。)(Install the Linux unzip tool if it's not already installed.)

    sudo yum install unzip
    sudo unzip linuxamd64_12102_grid_1of2.zip
    sudo unzip linuxamd64_12102_grid_2of2.zip
    
  5. 變更權限:Change permission:

    sudo chown -R grid:oinstall /opt/grid
    
  6. 更新設定的交換空間。Update configured swap space. Oracle Grid 元件需要至少 6.8 GB 的交換空間才能安裝 Grid。Oracle Grid components need at least 6.8 GB of swap space to install Grid. Azure 中 Oracle Linux 映像的預設分頁檔大小只有 2048 MB。The default swap file size for Oracle Linux images in Azure is only 2048MB. 您必須增加 /etc/waagent.conf 檔案中 ResourceDisk.SwapSizeMB 的值,並重新啟動 WALinuxAgent 服務,更新的設定才會生效。You need to increase ResourceDisk.SwapSizeMB in the /etc/waagent.conf file and restart the WALinuxAgent service in order for the updated settings to take effect. 由於其為唯讀檔案,因此您必須變更檔案權限才能啟用寫入權限。Because it is a read-only file, you need to change file permissions to enable write access.

    sudo chmod 777 /etc/waagent.conf  
    vi /etc/waagent.conf
    

    搜尋 ResourceDisk.SwapSizeMB,並將該值變更為 8192Search for ResourceDisk.SwapSizeMB and change the value to 8192. 您必須按 insert 進入插入模式,輸入 8192 值,然後按 esc 返回命令模式。You will need to press insert to enter insert mode, type in the value of 8192 and then press esc to return to command mode. 若要寫入變更並結束檔案,請輸入 :wq 並按 enterTo write the changes and quit the file, type :wq and press enter.

    注意

    強烈建議您一律使用 WALinuxAgent 設定交換空間,讓空間一律建立在本機暫時磁碟 (暫存磁碟) 上,以獲得最佳效能。We highly recommend that you always use WALinuxAgent to configure swap space so that it's always created on the local ephemeral disk (temporary disk) for best performance. 如需詳細資訊,請參閱如何在 Linux Azure 虛擬機器中新增分頁檔For more information on, see How to add a swap file in Linux Azure virtual machines.

讓本機用戶端和 VM 準備執行 x11Prepare your local client and VM to run x11

設定 Oracle ASM 時,您需要圖形化介面才能完成安裝和設定。Configuring Oracle ASM requires a graphical interface to complete the install and configuration. 我們會使用 x11 通訊協定簡化此安裝。We are using the x11 protocol to facilitate this installation. 如果您正在使用已啟用且已設定 X11 功能的用戶端系統 (Mac 或 Linux),則可以跳過這項特定於 Windows 電腦的組態和設定。If you are using a client system (Mac or Linux) that already has X11 capabilities enabled and configured - you can skip this configuration and setup exclusive to Windows machines.

  1. PuTTYXming 下載到 Windows 電腦。Download PuTTY and download Xming to your Windows computer. 繼續進行之前,您必須以預設值完成這兩個應用程式的安裝。You will need to complete the installation of both of these applications with the default values before proceeding.

  2. 安裝 PuTTY 之後,請開啟命令提示字元,變更至 PuTTY 資料夾 (例如,C:\Program Files\PuTTY),並執行 puttygen.exe 以產生金鑰。After you install PuTTY, open a command prompt, change into the PuTTY folder (for example, C:\Program Files\PuTTY), and run puttygen.exe in order to generate a key.

  3. 在 PuTTY 金鑰產生器中︰In PuTTY Key Generator:

    1. 選取 Generate 按鈕以產生金鑰。Generate a key by selecting the Generate button.
    2. 複製金鑰的內容 (Ctrl+C)。Copy the contents of the key (Ctrl+C).
    3. 選取 Save private key 按鈕。Select the Save private key button.
    4. 忽略與透過複雜密碼保護金鑰相關的警告,然後選取 OKIgnore the warning about securing the key with a passphrase, and then select OK.

    PuTTY 金鑰產生器的螢幕擷取畫面

  4. 在您的 VM 中,執行下列命令︰In your VM, run these commands:

    sudo su - grid
    mkdir .ssh 
    cd .ssh
    
  5. 建立名為 authorized_keys 的檔案。Create a file named authorized_keys. 在此檔案中貼上金鑰的內容,然後儲存檔案。Paste the contents of the key in this file, and then save the file.

    注意

    金鑰中必須包含字串 ssh-rsaThe key must contain the string ssh-rsa. 此外,金鑰的內容必須是單行文字。Also, the contents of the key must be a single line of text.

  6. 在用戶端系統上,啟動 PuTTY。On your client system, start PuTTY. 類別目錄 窗格中,移至 連線 ** > ** SSH > Auth。在 驗證的私密金鑰檔 方塊中,流覽至您稍早產生的金鑰。In the Category pane, go to Connection > SSH > Auth. In the Private key file for authentication box, browse to the key that you generated earlier.

    SSH 驗證選項的螢幕擷取畫面

  7. 在 [類別] 窗格中,移至 [連線] > [SSH] > [X11]。In the Category pane, go to Connection > SSH > X11. 選取 [啟用 X11 轉送] 核取方塊。Select the Enable X11 forwarding check box.

    SSH X11 轉送選項的螢幕擷取畫面

  8. 在 [類別] 窗格中,移至 [工作階段]。In the Category pane, go to Session. 在 [主機名稱] 對話方塊中,輸入 Oracle ASM VM <publicIPaddress>,填入新的 Saved Session 名稱,然後按一下 SaveEnter your Oracle ASM VM <publicIPaddress> in the host name dialog box, fill in a new Saved Session name and then click on Save. 儲存之後,請按一下 open 以連線至 Oracle ASM 虛擬機器。Once saved, click on open to connect to your Oracle ASM virtual machine. 第一次連線時,系統會警告您登錄中不會快取遠端系統。The first time you connect you are warned the remote system is not cached in your registry. 按一下 yes 新增該項目並繼續。Click on yes to add it and continue.

    PuTTY 工作階段選項的螢幕擷取畫面

安裝 Oracle Grid InfrastructureInstall Oracle Grid Infrastructure

若要安裝 Oracle Grid Infrastructure,請完成下列步驟:To install Oracle Grid Infrastructure, complete the following steps:

  1. grid 的身分登入。Sign in as grid. (您應該能夠順利登入,而不會收到需要輸入密碼的提示)。(You should be able to sign in without being prompted for a password.)

    注意

    如果您正在執行 Windows,開始安裝之前,請確定您已啟動 Xming。If you are running Windows, make sure you have started Xming before you begin the installation.

    cd /opt/grid
    ./runInstaller
    

    Oracle Grid Infrastructure 12c Release 1 安裝程式會隨即開啟Oracle Grid Infrastructure 12c Release 1 Installer opens. (安裝程式可能需要幾分鐘的時間才會啟動)。(It might take a few minutes for the installer to start.)

  2. 在 [選取安裝選項] 頁面上,選取 [為獨立伺服器安裝和設定 Oracle Grid Infrastructure]。On the Select Installation Option page, select Install and Configure Oracle Grid Infrastructure for a Standalone Server.

    安裝程式之 [選取安裝選項] 頁面的螢幕擷取畫面

  3. 在 [選取產品語言] 頁面上,請確定已選取 [英文] 或您想要使用的語言。On the Select Product Languages page, ensure English or the language that you want is selected. 按一下 [ next]。Click next.

  4. 在 [建立 ASM 磁碟群組] 頁面上︰On the Create ASM Disk Group page:

    • 輸入磁碟群組的名稱。Enter a name for the disk group.
    • 在 [備援] 底下選取 [外部]。Under Redundancy, select External.
    • 在 [配置單位大小] 底下選取 [4]。Under Allocation Unit Size, select 4.
    • 在 [新增磁碟] 底下選取 [ORCLASMSP]。Under Add Disks, select ORCLASMSP.
    • 按一下 [ next]。Click next.
  5. 在 [指定 ASM 密碼] 頁面上選取 [對這些帳戶使用相同密碼] 選項,然後輸入密碼。On the Specify ASM Password page, select the Use same passwords for these accounts option, and enter a password.

    安裝程式之 [指定 ASM 密碼] 頁面的螢幕擷取畫面

  6. 在 [指定管理選項] 頁面上,您可以選擇設定 EM Cloud Control。On the Specify Management Options page, you have the option to configure EM Cloud Control. 我們會略過此選項 - 按一下 next 以繼續。We are skipping this option - click next to continue.

  7. 在 [特殊權限作業系統群組] 頁面上使用預設設定。On the Privileged Operating System Groups page, use the default settings. 按一下 next 以繼續。Click next to continue.

  8. 在 [指定安裝位置] 頁面上,使用預設設定。On the Specify Installation Location page, use the default settings. 按一下 next 以繼續。Click next to continue.

  9. 在 [建立清查] 頁面上,將清查目錄變更至 /u01/app/grid/oraInventoryOn the Create Inventory page, change the Inventory Directory to /u01/app/grid/oraInventory. 按一下 next 以繼續。Click next to continue.

    安裝程式之 [建立清查] 頁面的螢幕擷取畫面

  10. 在 [Root 指令碼執行組態] 頁面上,選取 [自動執行組態指令碼] 核取方塊。On the Root script execution configuration page, select the Automatically run configuration scripts check box. 接著,選取 [使用 root 使用者認證] 選項,然後輸入 root 使用者密碼。Then, select the Use "root" user credential option, and enter the root user password.

    安裝程式之 [Root 指令碼執行組態] 頁面的螢幕擷取畫面

  11. 在 [執行必要條件檢查] 頁面上,目前的設定會失敗並顯示錯誤。On the Perform Prerequisite Checks page, the current setup will fail with errors. 這是預期中的行為。This is an expected behavior. 選取 Fix & Check AgainSelect Fix & Check Again.

  12. 在 [修復指令碼] 對話方塊中,按一下 OKIn the Fixup Script dialog box, click OK.

  13. 在 [摘要] 頁面上,檢閱您選取的設定,然後按一下 InstallOn the Summary page, review your selected settings, and then click Install.

    安裝程式之 [摘要] 頁面的螢幕擷取畫面

  14. 隨即顯示警告對話方塊,通知您必須以特殊權限使用者身分執行組態指令碼。A warning dialog box appears informing you configuration scripts need to be run as a privileged user. 按一下 Yes 以繼續。Click Yes to continue.

  15. 在 [完成] 頁面上,按一下 Close 以完成安裝。On the Finish page, click Close to finish the installation.

設定 Oracle ASM 安裝Set up your Oracle ASM installation

若要設定 Oracle ASM 的安裝,請完成下列步驟︰To set up your Oracle ASM installation, complete the following steps:

  1. 請確定您仍從 X11 工作階段以 grid 的身分登入。Ensure you are still signed in as grid, from your X11 session. 您可能需要按 enter 以恢復終端機。You might need to hit enter to revive the terminal. 然後啟動 Oracle 自動儲存體管理組態助理:Then launch the Oracle Automated Storage Management Configuration Assistant:

    cd /u01/app/grid/product/12.1.0/grid/bin
    ./asmca
    

    Oracle ASM Configuration Assistant 隨即開啟。Oracle ASM Configuration Assistant opens.

  2. 在 [設定 ASM: 磁碟群組] 對話方塊中,按一下 Create 按鈕,然後按一下 Show Advanced OptionsIn the Configure ASM: Disk Groups dialog box, click the Create button, and then click Show Advanced Options.

  3. 在 [建立磁碟群組] 對話方塊中:In the Create Disk Group dialog box:

    • 輸入磁碟群組名稱 DATAEnter the disk group name DATA.
    • 在 [選取成員磁碟] 底下選取 [ORCL_DATA] 和 [ORCL_DATA1]。Under Select Member Disks, select ORCL_DATA and ORCL_DATA1.
    • 在 [配置單位大小] 底下選取 [4]。Under Allocation Unit Size, select 4.
    • 按一下 ok 以建立磁碟群組。Click ok to create the disk group.
    • 按一下 ok 以關閉確認視窗。Click ok to close the confirmation window.

    [建立磁碟群組] 對話方塊的螢幕擷取畫面

  4. 在 [設定 ASM: 磁碟群組] 對話方塊中,按一下 Create 按鈕,然後按一下 Show Advanced OptionsIn the Configure ASM: Disk Groups dialog box, click the Create button, and then click Show Advanced Options.

  5. 在 [建立磁碟群組] 對話方塊中:In the Create Disk Group dialog box:

    • 輸入磁碟群組名稱 FRAEnter the disk group name FRA.
    • 在 [備援] 底下選取 [外部 (無)]。Under Redundancy, select External (none).
    • 在 [選取成員磁碟] 底下選取 [ORCL_FRA]。Under Select Member Disks, select ORCL_FRA.
    • 在 [配置單位大小] 底下選取 [4]。Under Allocation Unit Size, select 4.
    • 按一下 ok 以建立磁碟群組。Click ok to create the disk group.
    • 按一下 ok 以關閉確認視窗。Click ok to close the confirmation window.

    [建立磁碟群組] 對話方塊的螢幕擷取畫面

  6. 選取 [結束] 以關閉 ASM Configuration Assistant。Select Exit to close ASM Configuration Assistant.

    [設定 ASM: 磁碟群組] 對話方塊與 [結束] 按鈕的螢幕擷取畫面

建立資料庫Create the database

Azure Marketplace 映像上已安裝 Oracle 資料庫軟體。The Oracle database software is already installed on the Azure Marketplace image. 若要建立資料庫,請完成下列步驟:To create a database, complete the following steps:

  1. 將使用者切換為 Oracle 超級使用者,然後將接聽程式初始化以啟用記錄功能:Switch users to the Oracle superuser, and then initialize the listener for logging:

    su - oracle
    cd /u01/app/oracle/product/12.1.0/dbhome_1/bin
    ./dbca
    

    Database Configuration Assistant 隨即開啟。Database Configuration Assistant opens.

  2. 在 [資料庫作業] 頁面上,按一下 Create DatabaseOn the Database Operation page, click Create Database.

  3. 在 [建立模式] 頁面上︰On the Creation Mode page:

    • 輸入資料庫名稱。Enter a name for the database.
    • 在 [儲存體類型] 中,請確定已選取 [自動儲存體管理 (ASM)]。For Storage Type, ensure Automatic Storage Management (ASM) is selected.
    • 在 [資料庫檔案位置] 中,請使用預設的 ASM 建議位置。For Database Files Location, use the default ASM suggested location.
    • 在 [快速復原區域] 中,請使用預設的 ASM 建議位置。For Fast Recovery Area, use the default ASM suggested location.
    • 輸入 [管理密碼] 和 [確認密碼]。type in an Administrative Password and confirm password.
    • 確定已選取 create as container databaseensure create as container database is selected.
    • 輸入 pluggable database name 值。type in a pluggable database name value.
  4. 在 [摘要] 頁面上,檢閱您選取的設定,然後按一下 Finish 以建立資料庫。On the Summary page, review your selected settings, and then click Finish to create the database.

    [摘要] 頁面的螢幕擷取畫面

  5. 已建立資料庫。The Database has been created. 在 [完成] 頁面上,您可以選擇解除鎖定其他帳戶以使用此資料庫並變更密碼。On the Finish page, you have the option to unlock additional accounts to use this database and change the passwords. 如果您想要進行此操作,請選取 [密碼管理],否則請按一下 closeIf you wish to do so, select Password Management - otherwise click on close.

刪除 VMDelete the VM

您已從 Azure Marketplace 在 Oracle DB 映像上成功設定 Oracle 自動儲存體管理。You have successfully configured Oracle Automated Storage Management on the Oracle DB image from the Azure Marketplace. 如果您不再需要此 VM,則可以使用下列命令移除資源群組、VM 和所有相關資源:When you no longer need this VM, you can use the following command to remove the resource group, VM, and all related resources:

az group delete --name myResourceGroup

後續步驟Next steps

教學課程:設定 Oracle DataGuardTutorial: Configure Oracle DataGuard

教學課程:設定 Oracle GoldenGateTutorial: Configure Oracle GoldenGate

請檢閱建置 Oracle DBReview Architect an Oracle DB