-->
ASMLib 2.0 is available for free download from OTN. This section walks through the process of configuring a simple ASM instance by using ASMLib 2.0 and building a database that uses ASM for disk storage. First is using with ASMLib software or rpm and second is using with udev management in Linux. This article gives you steps for using ASMLib packages. Prerequisite: Installed Redhat Enterprise Linux 7 Operating System. Local repository or system is registered with RHN. Install asmlib and related packages.
Azure virtual machines provide a fully configurable and flexible computing environment. This tutorial covers basic Azure virtual machine deployment combined with the installation and configuration of Oracle Automated Storage Management (ASM). You learn how to:
- Create and connect to an Oracle Database VM
- Install and configure Oracle Automated Storage Management
- Install and configure Oracle Grid infrastructure
- Initialize an Oracle ASM installation
- Create an Oracle DB managed by ASM
Use Azure Cloud Shell
Azure hosts Azure Cloud Shell, an interactive shell environment that you can use through your browser. Cloud Shell lets you use either
bash
or PowerShell
to work with Azure services. You can use the Cloud Shell pre-installed commands to run the code in this article without having to install anything on your local environment.To launch Azure Cloud Shell:
Option | Example/Link |
---|---|
Select Try It in the upper-right corner of a code block. Selecting Try It doesn't automatically copy the code to Cloud Shell. | |
Go to https://shell.azure.com or select the Launch Cloud Shell button to open Cloud Shell in your browser. | |
Select the Cloud Shell button on the top-right menu bar in the Azure portal. |
To run the code in this article in Azure Cloud Shell:
- Launch Cloud Shell.
- Select the Copy button on a code block to copy the code.
- Paste the code into the Cloud Shell session with Ctrl+Shift+V on Windows and Linux, or Cmd+Shift+V on macOS.
- Press Enter to run the code.
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. Run
az --version
to find the version. If you need to install or upgrade, see Install Azure CLI.Prepare the environment
Create a resource group
To create a resource group, use the az group create command. An Azure resource group is a logical container in which Azure resources are deployed and managed. In this example, a resource group named myResourceGroup in the eastus region.
Create a VM
To create a virtual machine based on the Oracle Database image and configure it to use Oracle ASM, use the az vm create command.
The following example creates a VM named myVM that is a Standard_DS2_v2 size with four attached data disks of 50 GB each. If they do not already exist in the default key location, it also creates SSH keys. To use a specific set of keys, use the
--ssh-key-value
option.After you create the VM, Azure CLI displays information similar to the following example. Note the value for
publicIpAddress
. You use this address to access the VM.Connect to the VM
To create an SSH session with the VM and configure additional settings, use the following command. Replace the IP address with the
publicIpAddress
value for your VM.Install Oracle ASM
To install Oracle ASM, complete the following steps.
For more information about installing Oracle ASM, see Oracle ASMLib Downloads for Oracle Linux 6.
- You need to login as root in order to continue with ASM installation:
- Run these additional commands to install Oracle ASM components:
- Verify that Oracle ASM is installed:The output of this command should list the following components:
- ASM requires specific users and roles in order to function correctly. The following commands create the pre-requisite user accounts and groups:
- Verify users and groups were created correctly:The output of this command should list the following users and groups:
- Create a folder for user grid and change the owner:
Set up Oracle ASM
For this tutorial, the default user is grid and the default group is asmadmin. Ensure that the oracle user is part of the asmadmin group. To set up your Oracle ASM installation, complete the following steps:
- 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:The output of this command should look similar to the following, stopping with prompts to be answered.
- View the disk configuration:The output of this command should look similar to the following listing of available disks
- Format disk /dev/sdc by running the following command and answering the prompts with:
- n for new partition
- p for primary partition
- 1 to select the first partition
- press
enter
for the default first cylinder - press
enter
for the default last cylinder - press w to write the changes to the partition table
Using the answers provided above, the output for the fdisk command should look like the following: - Repeat the preceding fdisk command for
/dev/sdd
,/dev/sde
, and/dev/sdf
. - Check the disk configuration:The output of the command should look like the following:
- Check the Oracle ASM service status and start the Oracle ASM service:The output of the command should look like the following:
- Create Oracle ASM disks:The output of the command should look like the following:
- List Oracle ASM disks:The output of the command should list off the following Oracle ASM disks:
- 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.
- Change the folder permission:
Download and prepare Oracle Grid Infrastructure
To download and prepare the Oracle Grid Infrastructure software, complete the following steps:
- Download Oracle Grid Infrastructure from the Oracle ASM download page.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.
- After you download the .zip files to your client computer, you can use Secure Copy Protocol (SCP) to copy the files to your VM:
- 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:
- Unzip the files. (Install the Linux unzip tool if it's not already installed.)
- Change permission:
- Update configured swap space. Oracle Grid components need at least 6.8 GB of swap space to install Grid. The default swap file size for Oracle Linux images in Azure is only 2048MB. 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.Search forResourceDisk.SwapSizeMB
and change the value to 8192. You will need to pressinsert
to enter insert mode, type in the value of 8192 and then pressesc
to return to command mode. To write the changes and quit the file, type:wq
and pressenter
.NoteWe highly recommend that you always useWALinuxAgent
to configure swap space so that it's always created on the local ephemeral disk (temporary disk) for best performance. For more information on, see How to add a swap file in Linux Azure virtual machines.
Prepare your local client and VM to run x11
Configuring Oracle ASM requires a graphical interface to complete the install and configuration. We are using the x11 protocol to facilitate this installation. 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.
- 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.
- After you install PuTTY, open a command prompt, change into the PuTTY folder (for example, C:Program FilesPuTTY), and run
puttygen.exe
in order to generate a key. - In PuTTY Key Generator:
- Generate a key by selecting the
Generate
button. - Copy the contents of the key (Ctrl+C).
- Select the
Save private key
button. - Ignore the warning about securing the key with a passphrase, and then select
OK
.
- Generate a key by selecting the
- In your VM, run these commands:
- Create a file named
authorized_keys
. Paste the contents of the key in this file, and then save the file.NoteThe key must contain the stringssh-rsa
. Also, the contents of the key must be a single line of text. - On your client system, start PuTTY. 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.
- In the Category pane, go to Connection > SSH > X11. Select the Enable X11 forwarding check box.
- In the Category pane, go to Session. Enter your Oracle ASM VM
<publicIPaddress>
in the host name dialog box, fill in a newSaved Session
name and then click onSave
. Once saved, click onopen
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. Click onyes
to add it and continue.
Install Oracle Grid Infrastructure
To install Oracle Grid Infrastructure, complete the following steps:
- Sign in as grid. (You should be able to sign in without being prompted for a password.)NoteIf you are running Windows, make sure you have started Xming before you begin the installation.Oracle Grid Infrastructure 12c Release 1 Installer opens. (It might take a few minutes for the installer to start.)
- On the Select Installation Option page, select Install and Configure Oracle Grid Infrastructure for a Standalone Server.
- On the Select Product Languages page, ensure English or the language that you want is selected. Click
next
. - On the Create ASM Disk Group page:
- Enter a name for the disk group.
- Under Redundancy, select External.
- Under Allocation Unit Size, select 4.
- Under Add Disks, select ORCLASMSP.
- Click
next
.
- On the Specify ASM Password page, select the Use same passwords for these accounts option, and enter a password.
- On the Specify Management Options page, you have the option to configure EM Cloud Control. We are skipping this option - click
next
to continue. - On the Privileged Operating System Groups page, use the default settings. Click
next
to continue. - On the Specify Installation Location page, use the default settings. Click
next
to continue. - On the Create Inventory page, change the Inventory Directory to
/u01/app/grid/oraInventory
. Clicknext
to continue. - On the Root script execution configuration page, select the Automatically run configuration scripts check box. Then, select the Use 'root' user credential option, and enter the root user password.
- On the Perform Prerequisite Checks page, the current setup will fail with errors. This is an expected behavior. Select
Fix & Check Again
. - In the Fixup Script dialog box, click
OK
. - On the Summary page, review your selected settings, and then click
Install
. - A warning dialog box appears informing you configuration scripts need to be run as a privileged user. Click
Yes
to continue. - On the Finish page, click
Close
to finish the installation.
Set up your Oracle ASM installation
To set up your Oracle ASM installation, complete the following steps:
- Ensure you are still signed in as grid, from your X11 session. You might need to hit
enter
to revive the terminal. Then launch the Oracle Automated Storage Management Configuration Assistant:Oracle ASM Configuration Assistant opens. - In the Configure ASM: Disk Groups dialog box, click the
Create
button, and then clickShow Advanced Options
. - In the Create Disk Group dialog box:
- Enter the disk group name DATA.
- Under Select Member Disks, select ORCL_DATA and ORCL_DATA1.
- Under Allocation Unit Size, select 4.
- Click
ok
to create the disk group. - Click
ok
to close the confirmation window.
- In the Configure ASM: Disk Groups dialog box, click the
Create
button, and then clickShow Advanced Options
. - In the Create Disk Group dialog box:
- Enter the disk group name FRA.
- Under Redundancy, select External (none).
- Under Select Member Disks, select ORCL_FRA.
- Under Allocation Unit Size, select 4.
- Click
ok
to create the disk group. - Click
ok
to close the confirmation window.
- Select Exit to close ASM Configuration Assistant.
Create the database
The Oracle database software is already installed on the Azure Marketplace image. To create a database, complete the following steps:
- Switch users to the Oracle superuser, and then initialize the listener for logging:Database Configuration Assistant opens.
- On the Database Operation page, click
Create Database
. - On the Creation Mode page:
- Enter a name for the database.
- For Storage Type, ensure Automatic Storage Management (ASM) is selected.
- For Database Files Location, use the default ASM suggested location.
- For Fast Recovery Area, use the default ASM suggested location.
- type in an Administrative Password and confirm password.
- ensure
create as container database
is selected. - type in a
pluggable database name
value.
- On the Summary page, review your selected settings, and then click
Finish
to create the database. - 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. If you wish to do so, select Password Management - otherwise click on
close
.
Delete the VM
You have successfully configured Oracle Automated Storage Management on the Oracle DB image from the Azure Marketplace. When you no longer need this VM, you can use the following command to remove the resource group, VM, and all related resources:
Next steps
Review Architect an Oracle DB
Oracle Asmlib Download
ASMLIB
|