Configuring Oracle 10g ASM On Linux
Configuring Oracle 10g ASM On Linux
Configuring Oracle 10g ASM On Linux
ASM -
ASM i.e. Automatic Storage Management simplifies administration of Oracle related files by
allowing the administrator to reference disk groups rather than individual disks and files,
which ASM manages internally. On Linux, ASM is capable of referencing disks as raw
devices or by using the ASMLib software.
In this article, we assume that you have configured a RHEL system along with Oracle
Database Software on it. To install Oracle 10g Database Software, you can follow this link.
Do not create any database now, only install the Oracle Software.
Also we have 3 raw devices available for ASM configuration (sdb, sdc, sdd). We will see the
configuration of both, ASMLib as well as RAW devices in the below article.
Always create the raw devices as primary partition and allocate the whole disk. Dont make
multiple primary partitions on a single disk for ASM installation. It might not work properly.
Do the above steps for /dev/sdc and /dev/sdd device also.
Now check whether you are able to see the newly created raw devices.
# fdisk -l
2) ASMLib Configuration:
- Determine your kernel version and accordingly dowload the ASMLib software from OTN.
# uname -r
- The below packages were downloaded which were suitable for my kernel.
oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm
oracleasm-support-2.1.7-1.el5.i386.rpm
[Y From:
http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/168542.list]
[Good
http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html]
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 without typing an
answer will keep that current value. Ctrl-C will abort.
- Once the ASM kernel module is configured, now create the disks.
# /etc/init.d/oracleasm createdisk DATAGRP /dev/sdb1
Marking disk /dev/sdb1 as an ASM disk: [ OK ]
# /etc/init.d/oracleasm createdisk ARCHGRP /dev/sdc1
Marking disk /dev/sdc1 as an ASM disk: [ OK ]
# /etc/init.d/oracleasm createdisk LOGGRP /dev/sdd1
Marking disk /dev/sdd1 as an ASM disk: [ OK ]
# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
Assigning devices:
/dev/raw/raw1 --> /dev/sdb1
/dev/raw/raw1: bound to major 8, minor 17
/dev/raw/raw2 --> /dev/sdc1
/dev/raw/raw2: bound to major 8, minor 33
/dev/raw/raw3 --> /dev/sdd1
/dev/raw/raw3: bound to major 8, minor 49
done
The ASM raw disks are configured. You can start your database creation now.
- WELCOME Screen
A warning message will get displayed saying that Oracle Cluster Synchronization Service
(CSS) is not currently running.
When the execution is complete, click on OK button and again click Next to continue.
- CREATE ASM INSTANCE Screen
A confirmation window will get open for creating the ASM instance.
Click on OK and ASM instance will get created as shown in below pic.
- When using ASMLib, the Disk Path column will contain values as given below
ORCL:DATAGRP
ORCL:ARCHGRP
ORCL:LOGGRP
- When using raw devices, the Disk Path column will contain candidate disks
/dev/raw/raw1
/dev/raw/raw2
/dev/raw/raw3
Since we are using raw devices, select 1st raw device i.e. /dev/raw/raw1
Click on OK and the ASM Disk Creation will start.
- Similarly create ARCHGRP and LOGGRP disk groups as shown in above steps.
- Once all disk groups are configured, you should see 3 disk groups similar to the below pic.
Now on ASM DISK GROUPS Screen, click on Finish. You will get a popup window. Click
on No to continue.
- Now the ASM instance has been configured. You can check the ASM instance running as
below.
$ ps -ef | grep pmon
5) Listener Configuration:
- Before starting with the database creation, configure the listener and register ASM instance
with it.
$ netca
- If you dont see the ASM instance register with the listener service, then do the below steps
$ export ORACLE_SID=+ASM
$ sqlplus / as sysdba
SQL> alter system register;
SQL> exit
$ lsnrctl status
Now you will see that the ASM instance has been registered with the listener service.
6) Create Database:
- Start DBCA.
$ dbca
- WELCOME Screen
- OPERATIONS Screen
Select Create a Database and click on Next to continue.
If you want to configure your database with Enterprise Manager, then check the option
Configure the database with Enterprise Manager else uncheck it.
Click on Next to continue.
Click on Multiplex Redo Logs and Control Files and enter path as shown below,
If you want to enable archiving mode, select Enable Archiving and click Edit Archive
Mode Parameters. Enter the path as shown below.
- CONFIRMATION Screen
Click on OK to start the installation.
- The Database has been created using ASM as storage option. You can verify the location of
database files as below,
$ ps -ef | grep pmon
$ ps -ef | grep lsn
$ export ORACLE_SID=asmdb
$ sqlplus / as sysdba
SQL> select name from v$datafile;
SQL> select name from v$tempfile;
SQL> select name from v$controlfile;
SQL> select member from v$logfile;
SQL> show parameter log_archive_file_dest;
SQL> show parameter db_recover;
- Shutdown any databases using the ASM instance, but leave the ASM instance itself running.
- Alter the ASM disk string to exclude the raw devices used earlier, then shutdown the ASM
instance.
SQL> ALTER SYSTEM SET asm_diskstring = ORCL:DISK* SCOPE=SPFILE;
System altered.
SQL>
- At this point the disks will not be used by ASM because they are not stamped. Now issue
the renamedisk command as the root user for each disk.
Notice, the stamp matches the discovery string set earlier. The ASM instance can now be
started.
SQL> STARTUP
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL>
The ASM instance is now using ASMLib, rather than raw devices. All dependent databases
can now be started.
- Alter the ASM disk string to match the raw devices that you want to use, then shutdown the
ASM instance.
SQL> ALTER SYSTEM SET asm_diskstring = /dev/raw/raw* SCOPE=SPFILE;
System altered.
SQL>
- Perform all the steps listed in the Raw Device Setup, then start the ASM instance.
SQL> STARTUP
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL>
The ASM instance is now using the disks as raw devices, rather than as ASMLib disks. All
dependent databases can now be started
http://chotustuff.wordpress.com/2012/01/29/oracle-asm-installation-steps-in-linux/
One More...
The ASM disks can be non formatted partitions from your disk already installed for OS and
they can even be OS files configured as disks. But if we use VMWare then we can add more
virtual disks to the system without any cost simulating our test environment with a real time
ASM configurations where many disks are used on different controllers to take benefit of
ASM mirroring and stripping of data. See below how to add more disks to the Virtual
machine.
3. On the Hard Disk Properties page select the capacity for the disk along with other options.
Hard Disk Properties
Notice the "Allocate all disk space now" unchecked. Its best to leave it unchecked.
5. After you finish the add hardware wizard you should see your changes in the hardware on
the summary page of the virtual machine.
Ready to Complete
I have added 4 disks of size 4G each and all on different SCSI disk controller. We usually do
this to get most out of the ASM disk mirroring i.e. even if one disk is dead, Oracle will still
be able to read data from mirrored copies from other disks. But think about all of your disks
are on one disk controller and that whole controller is burnt, then you loose all of your data.
Now power on your Virtual machine from the commands panel on the right side of the VM
console and login as root.
# ls /dev/sd*
/dev/sda /dev/sda2 /dev/sda4 /dev/sda6 /dev/sdc /dev/sde
/dev/sda1 /dev/sda3 /dev/sda5 /dev/sdb /dev/sdd
# cat /proc/partitions
major minor #blocks name
8 0 26214400 sda
8 1 104391 sda1
8 2 10482412 sda2
8 3 3148740 sda3
8 4 1 sda4
8 5 1052226 sda5
8 6 11422183 sda6
8 16 4194304 sdb
8 32 4194304 sdc
8 48 4194304 sdd
8 64 4194304 sde
/*
Since we added SCSI disks so you should see then in /dev/sd*.
sda is our main disk where OS and other apps are installed and
sda1 to sda6 are its partitions.
sdb to sde are the new four disks that we have just added.
The output from 'cat /proc/partitions' shows they are not
partitioned yet. We have to create at least one partition in each
disk.
We can have more then one partitions and use each partition as a
different ASM disk.
I am going to create one partition in all disks.
*/
# fdisk /dev/sdb
/*
Repeat the fdisk operation for all 4 disks in the same way as
demonstrated above.
*/
# cat /proc/partitions
major minor #blocks name
8 0 26214400 sda
8 1 104391 sda1
8 2 10482412 sda2
8 3 3148740 sda3
8 4 1 sda4
8 5 1052226 sda5
8 6 11422183 sda6
8 16 4194304 sdb
8 17 4192933 sdb1
8 32 4194304 sdc
8 33 4192933 sdc1
8 48 4194304 sdd
8 49 4192933 sdd1
8 64 4194304 sde
8 65 4192933 sde1
#
# uname -r
2.6.18-164.el5
With the oracleasm utility installed, configure the kernel module for ASM.
# /etc/init.d/oracleasm configure
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 without typing an
answer will keep that current value. Ctrl-C will abort.
After the kernel module is updated, label the disks as ASM disks and give then an ASM
name.
listsdisks will list all ASM disks. Make sure you see all the disks you configured.
# /etc/init.d/oracleasm listdisks
ASM1
ASM2
ASM3
ASM4
#
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdc1
/dev/raw/raw3 /dev/sdd1
/dev/raw/raw4 /dev/sde1
NOTE: Raw devices setup or the ASMLib setup are two different mutually exclusive ways to
configure ASM disks. You will use either one of those not both.
If you are using RHEL5.0 or 5.1 then you won't find the rawdevices service or the
/etc/sysconfig/rawdevices file, please refer to the links provided below.
See also:
How to install ASM instance on a non-asm Oracle database
How to configure Raw Disks in RHEL 5
How to migrate Oracle datafiles to ASM storage via RMAN
How to migrate online redo logs to Oracle ASM storage
Migrate Oracle Flash Recovery Area to ASM storage via RMAN
Add ASM Instance into Enterprise Manager