I have configured two devices for ASM – one with ASMLib and one with UDEV:
[root@krol-julian ~]# cat /etc/udev/rules.d/99-asm-dev.rules
KERNEL=="sdb1",OWNER="oracle",GROUP="dba",MODE="0660"
[root@krol-julian ~]# ls -al /dev/sdb1
brw-rw----. 1 oracle dba 8, 17 05-14 11:28 /dev/sdb1
[root@krol-julian ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@krol-julian ~]# oracleasm listdisks
DATA
[root@krol-julian ~]# ls -al /dev/oracleasm/disks/DATA
brw-rw----. 1 oracle dba 8, 18 05-14 11:26 /dev/oracleasm/disks/DATA
I have downloaded 11.2.0.4 grid infrastructure binaries and prepared response file:
[root@krol-julian ~]# su - oracle
[oracle@krol-julian ~]$ cd 11.2.0.4/grid/
[oracle@krol-julian grid]$ cd response/
[oracle@krol-julian response]$ egrep "ORACLE_HOSTNAME|INVENTORY_LOCATION|oracle.install.option|ORACLE_BASE|ORACLE_HOME|oracle.install.asm.OSDBA|oracle.install.asm.OSASM" grid_install.rsp
ORACLE_HOSTNAME=krol-julian
INVENTORY_LOCATION=/u01/app/oraInventory
oracle.install.option=CRS_SWONLY
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/grid
oracle.install.asm.OSDBA=dba
oracle.install.asm.OSASM=oinstall
Of course in production environment you have set different groups for security reasons. If you think that you can ignore security, read my articles regarding privilege escalations: https://blog.ora-600.pl/category/oracle/security/
With those setting I will get a set of warining but the installation will proceed.
[oracle@krol-julian grid]$ ./runInstaller -silent -showProgress -ignorePrereq -responseFile /home/oracle/11.2.0.4/grid/response/grid_install.rsp
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 11138 MB Passed
Checking swap space: must be greater than 150 MB. Actual 3967 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-05-14_12-02-53PM. Please wait ...[oracle@krol-julian grid]$ [WARNING] [INS-41809] Possible invalid choice for OSDBA Group.
CAUSE: The group name you selected as the OSDBA for ASM group is commonly used for Oracle Database administrator privileges.
ACTION: Oracle recommends that you designate asmdba as the OSDBA for ASM group, and that the group should not be the same group as an Oracle Database OSDBA group.
[WARNING] [INS-41874] Oracle ASM Administrator (OSASM) Group specified is same as the inventory group.
CAUSE: Operating system group oinstall specified for OSASM Group is same as the inventory group.
ACTION: It is not recommended to have OSASM group same as inventory group. Select any of the group other than the inventory group to avoid misconfiguration.
[WARNING] [INS-32022] Grid infrastructure software for a cluster installations must not be under an Oracle base directory.
CAUSE: Grid infrastructure for a cluster installations assign root ownership to all parent directories of the Grid home location. As a result, ownership of all named directories in the software location path are changed to root, creating permissions errors for all subsequent installations into the same Oracle base.
ACTION: Specify software location outside of an Oracle base directory for grid infrastructure for a cluster installations.
You can find the log of this install session at:
/u01/app/oraInventory/logs/installActions2015-05-14_12-02-53PM.log
Prepare in progress.
.................................................. 9% Done.
Prepare successful.
Copy files in progress.
.................................................. 14% Done.
.................................................. 23% Done.
.................................................. 28% Done.
.................................................. 33% Done.
.................................................. 38% Done.
.................................................. 45% Done.
.................................................. 52% Done.
.................................................. 60% Done.
.................................................. 65% Done.
.................................................. 70% Done.
.................................................. 75% Done.
..............................
Copy files successful.
Link binaries in progress.
..........
Link binaries successful.
..........
Setup files in progress.
.................................................. 80% Done.
.................................................. 94% Done.
Setup files successful.
The installation of Oracle Grid Infrastructure 11g was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2015-05-14_12-02-53PM.log' for more details.
Execute Root Scripts in progress.
As a root user, execute the following script(s):
1. /u01/app/oracle/product/11.2.0.4/grid/root.sh
.................................................. 100% Done.
Execute Root Scripts successful.
Successfully Setup Software.
Now run the root.sh script as requested
[root@krol-julian ~]# /u01/app/oracle/product/11.2.0.4/grid/root.sh
Check /u01/app/oracle/product/11.2.0.4/grid/install/root_krol-julian_2015-05-14_12-07-17.log for the output of root script
[root@krol-julian ~]# cat /u01/app/oracle/product/11.2.0.4/grid/install/root_krol-julian_2015-05-14_12-07-17.log
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0.4/grid
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/u01/app/oracle/product/11.2.0.4/grid/perl/bin/perl -I/u01/app/oracle/product/11.2.0.4/grid/perl/lib -I/u01/app/oracle/product/11.2.0.4/grid/crs/install /u01/app/oracle/product/11.2.0.4/grid/crs/install/roothas.pl
To configure Grid Infrastructure for a Cluster execute the following command:
/u01/app/oracle/product/11.2.0.4/grid/crs/config/config.sh
This command launches the Grid Infrastructure Configuration Wizard. The wizard also supports silent operation, and the parameters can be passed through the response file that is available in the installation media.
Because we want to install ASM I will execute the first script
[root@krol-julian ~]# /u01/app/oracle/product/11.2.0.4/grid/perl/bin/perl -I/u01/app/oracle/product/11.2.0.4/grid/perl/lib -I/u01/app/oracle/product/11.2.0.4/grid/crs/install /u01/app/oracle/product/11.2.0.4/grid/crs/install/roothas.pl
Using configuration parameter file: /u01/app/oracle/product/11.2.0.4/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node krol-julian successfully pinned.
Adding Clusterware entries to upstart
krol-julian 2015/05/14 12:11:33 /u01/app/oracle/product/11.2.0.4/grid/cdata/krol-julian/backup_20150514_121133.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
Ok. Now we have to prepare appropriate environment. For example:
[root@krol-julian ~]# cat /home/oracle/grid.env
export ORACLE_SID=+ASM
export ORACLE_BASE=/u01/app/oracle
export PATH=/u01/app/oracle/product/11.2.0.4/grid/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
export ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/grid
Now we can create listener and ASM
[oracle@krol-julian ~]$ srvctl add listener -p "TCP:1521" -d ORCL:*,/dev/sd*
[oracle@krol-julian ~]$ srvctl start listener
[oracle@krol-julian ~]$ srvctl add asm -l LISTENER
[oracle@krol-julian ~]$ srvctl start asm
And now we can create diskgroups
SQL> create diskgroup data1
2 external redundancy disk 'ORCL:DATA';
Diskgroup created.
SQL> create diskgroup data2
2 external redundancy disk '/dev/sdb1';
Diskgroup created.
SQL> select name, usable_file_mb from v$asm_diskgroup;
NAME USABLE_FILE_MB
------------------------------ --------------
DATA1 6084
DATA2 6099
FIELD NOTES