Sunday, May 4, 2014

Step by Step: Installing Oracle Database 11g R2 Express Edition on Oracle Enterprise Linux x86-64

Oracle Database 11g R2 Express Edition has some limitation compared to Standard and Enterprise Edition:
  1. Express Edition is limited to a single instance on any server
  2. Express Edition may be installed on a multiple CPU server, but may only be executed on one processor in any server
  3. Express Edition may only be used to support up to 11GB of user data (not including Express Edition system data)
  4. Express Edition may use up to 1 GB RAM of available memory
  5. Express Edition can work only in Windows x32 and Linux x64 
Oracle Express Edition can be distributed and can be used to provide third party demonstration and training. (all the above information is taken from oracle.com)

Prerequisites Software:
  1. VMware Workstation (VMware Workstation Link)
  2. Oracle Enterprise Linux (Oracle Enterprise Linux Link)
  3. Oracle Database (Oracle Database Link)
In this guide the below software versions are used:
  1. VMware Workstation v10.0.0
  2. Oracle Enterprise Linux v5.7 x86-64
  3. Oracle Database Express Edition 11g R2 for Linux x86-64
Installation of VMware Workstation and OEL is not covered in this guide because it is straightforward. Just install them, start them. (Notice that during the installation of OEL you must check oracle-validated-1.1.* package in system tools)

To install Oracle Database Express Edition:
  • Log in as root user and run the executable 'oracle-xe-11.2.0-1.0.x86_64.rpm'
  • You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.
  • Enter the following information:
    • Specify the HTTP port that will be used for Oracle Application Express [8080]:
    • Specify a port that will be used for the database listener [1521]:
    • Specify a password to be used for database accounts.  Note that the same
      password will be used for SYS and SYSTEM.  Oracle recommends the use of
      different passwords for each database account.  This can be done after
      initial configuration:
      Confirm the password:
    • Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:
  • Installation will complete successfully and will start automatically in next reboot.
  •  This completes configuration. You can use any Oracle client to connect to Oracle instance.

Monday, August 19, 2013

Step By Step: ALTER DATABASE BACKUP CONTROLFILE TO TRACE

Control file is so critical to the operation of the database, so it must be multiplexed (one or more control files can be copied). However, no matter how many copies of the control file are associated with an instance, only one of the control files is designated as primary for purposes of retrieving database metadata.

The ALTER DATABASE BACKUP CONTROLFILE TO TRACE command is one way to back up the control file. It produces a SQL script that you can use to re-create the database control file in case all multiplexed binary versions of the control file are lost due to a catastrophic failure.

This trace file can also be used, for example, to re-create a control file if the database needs to be renamed or to change various database limits that could not otherwise be changed without re-creating the entire database.

Steps to backup controlfile:

Find the path where oracle stores trace files:

[oracle@home trace]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Aug 13 16:48:33 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> show parameter USER_DUMP_DEST;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
user_dump_dest                       string      /home/oracle/app/oracle/diag/rdbms/orcl/orcl/trace
SQL>

Go to trace path directory and remove all existing ones:

[oracle@home trace]$ cd /home/oracle/app/oracle/diag/rdbms/orcl/orcl/trace/
[oracle@home trace]$ rm *
[oracle@home trace]$ ll
total 0

Login in to database as sysdba and execute command ALTER DATABASE BACKUP CONTROLFILE TO TRACE:

[oracle@home trace]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Aug 13 16:52:40 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE;

Database altered.

SQL>

Go to trace path directory and explore the content of alert_orcl.log

[oracle@home trace]$ cat alert_orcl.log
Tue Aug 13 16:53:15 2013
ALTER DATABASE BACKUP CONTROLFILE TO TRACE
Backup controlfile written to trace file /home/oracle/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_9818.trc
Completed: ALTER DATABASE BACKUP CONTROLFILE TO TRACE
[oracle@home trace]$

You will find where SQL script is stored. Explore the content of orcl_ora_9818.trc. Inside you will find two SQL scripts. First must be used if online logs are available and second must be used if online logs are unavailable. Below you will find the content:

[oracle@home trace]$ cat orcl_ora_9818.trc
Trace file /home/oracle/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_9818.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1
System name:    Linux
Node name:      home.test.al
Release:        2.6.32-200.13.1.el5uek
Version:        #1 SMP Wed Jul 27 21:02:33 EDT 2011
Machine:        x86_64
Instance name: orcl
Redo thread mounted by this instance: 1
Oracle process number: 24
Unix process pid: 9818, image: oracle@home.test.al (TNS V1-V3)


*** 2013-08-13 16:53:15.077
*** SESSION ID:(12.97) 2013-08-13 16:53:15.077
*** CLIENT ID:() 2013-08-13 16:53:15.077
*** SERVICE NAME:(SYS$USERS) 2013-08-13 16:53:15.077
*** MODULE NAME:(sqlplus@home.test.al (TNS V1-V3)) 2013-08-13 16:53:15.077
*** ACTION NAME:() 2013-08-13 16:53:15.077

-- The following are current System-scope REDO Log Archival related
-- parameters and can be included in the database initialization file.
--
-- LOG_ARCHIVE_DEST=''
-- LOG_ARCHIVE_DUPLEX_DEST=''
--
-- LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf
--
-- DB_UNIQUE_NAME="orcl"
--
-- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG'
-- LOG_ARCHIVE_MAX_PROCESSES=4
-- STANDBY_FILE_MANAGEMENT=MANUAL
-- STANDBY_ARCHIVE_DEST=?/dbs/arch
-- FAL_CLIENT=''
-- FAL_SERVER=''
--
-- LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST'
-- LOG_ARCHIVE_DEST_1='MANDATORY NOREOPEN NODELAY'
-- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM EXPEDITE NOVERIFY SYNC'
-- LOG_ARCHIVE_DEST_1='NOREGISTER NOALTERNATE NODEPENDENCY'
-- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'
-- LOG_ARCHIVE_DEST_1='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'
-- LOG_ARCHIVE_DEST_STATE_1=ENABLE
--
-- Below are two sets of SQL statements, each of which creates a new
-- control file and uses it to open the database. The first set opens
-- the database with the NORESETLOGS option and should be used only if
-- the current versions of all online logs are available. The second
-- set opens the database with the RESETLOGS option and should be used
-- if online logs are unavailable.
-- The appropriate set of statements can be copied from the trace into
-- a script file, edited as necessary, and executed when there is a
-- need to re-create the control file.
--
--     Set #1. NORESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- Additional logs may be required for media recovery of offline
-- Use this only if the current versions of all online logs are
-- available.
-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '+DATA/orcl/onlinelog/group_1.261.823264035'  SIZE 50M BLOCKSIZE 512,
  GROUP 2 '+DATA/orcl/onlinelog/group_2.262.823264041'  SIZE 50M BLOCKSIZE 512,
  GROUP 3 '+DATA/orcl/onlinelog/group_3.263.823264045'  SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '+DATA/orcl/datafile/system.256.823263827',
  '+DATA/orcl/datafile/sysaux.257.823263829',
  '+DATA/orcl/datafile/undotbs1.258.823263829',
  '+DATA/orcl/datafile/users.259.823263829',
  '+DATA/orcl/datafile/example.265.823264121',
  '+DATA/orcl/datafile/rman.267.823311675'
CHARACTER SET WE8MSWIN1252
;
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '+FRA';
-- ALTER DATABASE REGISTER LOGFILE '+FRA';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE
-- All logs need archiving and a log switch is needed.
ALTER SYSTEM ARCHIVE LOG ALL;
-- Database can now be opened normally.
ALTER DATABASE OPEN;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '+DATA/orcl/tempfile/temp.264.823264093'
     SIZE 20971520  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
-- End of tempfile additions.
--
--     Set #2. RESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- The contents of online logs will be lost and all backups will
-- be invalidated. Use this only if online logs are damaged.
-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '+DATA/orcl/onlinelog/group_1.261.823264035'  SIZE 50M BLOCKSIZE 512,
  GROUP 2 '+DATA/orcl/onlinelog/group_2.262.823264041'  SIZE 50M BLOCKSIZE 512,
  GROUP 3 '+DATA/orcl/onlinelog/group_3.263.823264045'  SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '+DATA/orcl/datafile/system.256.823263827',
  '+DATA/orcl/datafile/sysaux.257.823263829',
  '+DATA/orcl/datafile/undotbs1.258.823263829',
  '+DATA/orcl/datafile/users.259.823263829',
  '+DATA/orcl/datafile/example.265.823264121',
  '+DATA/orcl/datafile/rman.267.823311675'
CHARACTER SET WE8MSWIN1252
;
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '+FRA';
-- ALTER DATABASE REGISTER LOGFILE '+FRA';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE USING BACKUP CONTROLFILE
-- Database can now be opened zeroing the online logs.
ALTER DATABASE OPEN RESETLOGS;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '+DATA/orcl/tempfile/temp.264.823264093'
     SIZE 20971520  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
-- End of tempfile additions.
--
[oracle@home trace]$


Sunday, August 18, 2013

Solved: asm_version() failed with code 2

Sometimes when executing oracleasm-discover command, after rebooting Linux system we are getting the following error message: 

[root@home ~]# oracleasm-discover
Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
asm_version() failed with code 2

Steps to solve the problem (root user)

Check if oracleasm is started
root@home ~]# oracleasm status
Checking if ASM is loaded: no
Checking if /dev/oracleasm is mounted: no

Start oracleasm
[root@home ~]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Mounting ASMlib driver filesystem: /dev/oracleasm

Try again to execute oracleasm-discover (error doesn't appear again)
[root@home ~]# oracleasm-discover
Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
[ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]

Execute oracleasm scandisks
[root@home ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "DSK03"
Instantiating disk "DSK01"
Instantiating disk "DSK02"

Execute oracleasm listdisks
[root@home ~]# oracleasm listdisks
DSK01
DSK02
DSK03

Try again to execute oracleasm-discover
[root@home ~]# oracleasm-discover
Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
[ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
Discovered disk: ORCL:DSK01 [10414078 blocks (5332007936 bytes), maxio 512]
Discovered disk: ORCL:DSK02 [10414078 blocks (5332007936 bytes), maxio 512]
Discovered disk: ORCL:DSK03 [10414078 blocks (5332007936 bytes), maxio 512]

If oracle or grid user is logged in the error message appears again.

Steps to solve the problem (oracle or grid user)

[oracle@home ~]$ /usr/sbin/oracleasm-discover
Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
asm_version() failed with code 2

Oracle or grid user must have appropriate privilege in order to discover ASM disks. Back as root user point to /dev/oracleasm  and execute below commands:
[root@home /]# cd /dev/oracleasm/
[root@home oracleasm]# ls -lart
total 0
drwxr-xr-x  4 root root    0 Aug 13 14:32 .
drwxrwx---  1 root root    0 Aug 13 14:32 iid
drwxr-xr-x  1 root root    0 Aug 13 14:32 disks
-rwxrwx---  1 root root    0 Aug 13 14:32 .query_version
-rwxrwx---  1 root root    0 Aug 13 14:32 .get_iid
-rwxrwx---  1 root root    0 Aug 13 14:32 .check_iid
-rwxrwx---  1 root root    0 Aug 13 14:32 .query_disk
drwxr-xr-x 13 root root 4440 Aug 13 14:35 ..
[root@home oracleasm]# chown -R oracle:oinstall iid disks .query_version .get_iid .check_iid .query_disk

Log in as oracle or grid and execute below commands:
[root@home oracleasm]# su oracle
[oracle@home oracleasm]$ /usr/sbin/oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Unable to fix permissions on ASM disk "DSK01"
[oracle@home oracleasm]$ /usr/sbin/oracleasm listdisks
DSK01
DSK02
DSK03
[oracle@home oracleasm]$ /usr/sbin/oracleasm-discover
Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so
[ASM Library - Generic Linux, version 2.0.4 (KABI_V2)]
Discovered disk: ORCL:DSK01 [10414078 blocks (5332007936 bytes), maxio 512]
Discovered disk: ORCL:DSK02 [10414078 blocks (5332007936 bytes), maxio 512]
Discovered disk: ORCL:DSK03 [10414078 blocks (5332007936 bytes), maxio 512]
[oracle@home oracleasm]$

Oracle or grid user can now discover ASM disks.

Saturday, January 26, 2013

Step By Step: Configuring Automatic Storage Management (ASM) on Standalone Server with Oracle Enterprise Linux (OEL with Oracle 11g R2 Installed) using External Storage Managed by Openfiler

1) Cygwin
  • Installation of Cygwin (v1.7.16-1) 

2) Oracle Enterprise Linux (v5.7 64 bit) & Oracle DB 11g R2
  • Installation of OEL
  • Creation of Oracle Enterprise Linux Virtual Machine
  •  Installation of Oracle Enterprise Linux
  • Connection between Host and Guest
  • Oracle Linux pre-installation steps for Oracle DB 11g R2
  • Installation of Oracle DB 11g R2

3) Openfiler (v2.99)
  • Openfiler Overview
  • Download Openfiler
  • Installation of Openfiler  

4) Creation and Configuration of ASM
  • Add three hard disks to Openfiler virtual machine
  • Creation of new physical volume
  • Enable all openfiler services  
  • Register Oracle Linux at "Network Access Configuration" under "System" tab 
  • Creation of logical volumes asmdisk01, asmdisk02, asmdisk03
  • Assign iSCSI target to newly created volumes
  • Configure iSCSI disk devices for Oracle ASM with ASMLib

5) Installation of Grid Infrastructure


6) Creation of Database


Installation of Cygwin
Cygwin is a collection of tools which provide a Linux look environment for Windows. Since we are going to install Oracle 11g R2 on OEL without GUI, Oracle DB needs an X-terminal to display user interfaces and Cygwin helps us display them on Windows host by setting the DISPLAY environment variable point to Windows host. For the download & installation of Cygwin please refer to Step By Step: Installing Oracle 11g R2 on Oracle Enterprise Linux without GUI (Graphical User Interface).

Installation of OEL & Oracle DB 11g R2
Oracle Enterprise Linux is Oracle's Linux distribution based on Red Hat Enterprise Linux. Please refer to Step By Step: Installing Oracle 11g R2 on Oracle Enterprise Linux without GUI (Graphical User Interface) for:
  • Creation of Oracle Enterprise Linux Virtual Machine
  • Installation of Oracle Enterprise Linux
  • Connection between Host and Guest
  • Oracle Linux pre-installation steps for Oracle DB 11g R2
  • Installation of Oracle DB 11g R2 (Note: During "Create and Configure a Database" check "Install Database Software Only". We are going to create and configure database later.) 

Openfiler Overview
Openfiler takes the pain out of deploying and managing networked storage. The hardware, any industry standard server will do, is combined with Openfiler software and the result is a powerful networked storage solution that exports data via a full suite of industry standard storage networking protocols. Openfiler lowers deployment and maintenance costs for networked storage without compromising functionality or performance. 

Openfiler is a network storage operating system, fronted by a web based management user interface. With the features built into Openfiler, everyone can take advantage of file-based Network Attached Storage and block-based Storage Area Networking functionality in a single cohesive framework. 

Any industry standard x86 or x86/64 server can be converted into a powerful multi-protocol network storage appliance, replete with an intuitive browser-based management interface, in as little as 15 minutes. File-based storage networking protocols such as CIFS and NFS ensure cross-platform compatibility in homogeneous networks - with client support for Windows, Linux, and Unix. Fibre channel and iSCSI target features provide excellent integration capabilities for virtualization environments such as Xen and VMware.

iSCSI target functionality is especially useful for enterprise applications such as Microsoft Exchange server integration, Oracle 11g RAC backend storage or video surveillance and disk-to-disk backup - taken from Openfiler website.

Download Openfiler
Openfiler can be download directly from openfiler website
http://www.openfiler.com/community/download/ -> Openfiler NAS/SAN Appliance, version 2.99 (Final Release) - 507 MB

Installation of Openfiler
Open VMware and start creating a new virtual machine


Select Custom (advanced) to create virtual machine with advanced options


Next


Select Installer disk image file (iso) and navigate to the openfiler downloaded file. It will display a warning that could not detect which operation system is on disk image. Do not worry we will choose other linux kernel later.


Select linux under guest operating system and choose Other linux 2.6.x kernel 64-bit

  

Specify a name for virtual machine and the location where it will be stored.


Specify number of processors for this virtual machine


Specify the amount of memory you would like to use for this virtual machine


Select use bridge networking as type of network connection


Select LSI Logic (Recommended)


Select create a new virtual disk

  
Select SCSI (Recommended)


Specify how much you want this disk to be and select split virtual disk into 2 GB files


 Specify the location of storage

  
Review your configuration and after checking power on this virtual machine after creation click finish


Click Enter to install using graphical mode


Next


Select U.S. English as appropriate language for the keyboard

  
Click YES to format the data on virtual disk 


Leave defaults and continue to next step


Click YES to remove all partitions on /dev/sda


Configure manually IPv4 (192.168.1.8/24) and disable IPv6


  
Specify hostname (home.test.al) and if you do not have any DNS server configured in your home environment leave other fields empty 


 Click continue and specify time zone (Tirane/Albania)


Specify root password


Click next to start the installation

  
The installation will start and it won't take much time

  
After the installation is completed, reboot the system


Last screen from installation

   
Once the system boots up, start configuring Openfiler by pointing your browser at the host name or IP address of the Openfiler system. The interface is accessible from https port 446. e.g.. https://192.168.1.8:446

Management Interface: https://<ip of openfiler host>:446
Administrator Username: openfiler
Administrator Password: password

Add three hard disks to Openfiler virtual machine 
Shutdown openfiler virtual machine first by shutdown -h now command.

Click Edit Virtual Machine Settings and press Add button


 Select Hard Disk and press Next


Choose Create a new virtual disk and press Next


Choose SCSI (Recommended) and press Next


Specify Maximum disk size as 5GB and choose Split virtual disk into 2GB files. Press Next



  Choose Openfiler OS and press Finish


Add two more disks by following the above procedure. At the end it must look like the below prt sc


Creation of new physical volume
Log in to openfiler administration website and go to Volume -> Create new physical volumes



The below prt sc should appear. Choose /dev/sdb.


Go at section Create a partition in /dev/sdb and by leaving the defaults press create. /dev/sdb1 partition will be created. By clicking on Block Device (right panel), do the same for /dev/sdc and /dev/sdd


Enable all openfiler services  
Log in to openfiler web app and go to services tab. Enable all of them



Register Oracle Linux at "Network Access Configuration" under "System" tab 
Like the following prt sc oracle linux must be registered. Just enter the Name (Oracle Linux), IP (192.168.1.7) and NetmaskMask (255.255.255.0) and press update



Creation of logical volumes asmdisk01, asmdisk02, asmdisk03
Go to "Volume Group" in the right panel. Enter asmdisk03 in "Volume group name (no spaces)" text box and choose a physical volume, in my case /dev/sdd1. Press "Add volume group".




Go to "Add Volume" and fill the appropriate values for asmdisk03. Note that file system type should be iSCSI.



Assign iSCSI target to newly created volumes
Click "iSCSI target" in the right panel. Enter the name for target IQN (iqn-asmdisk01), leave settings as defaults. In "LUN Mapping" locate asmdisk03 and press Map. R/W Mode should be write-thru. In Network ACL allow Oracle Linux to write to this disk. Do the same for asmdisk01 and asmdisk02.

Return to Openfiler OS and restart iscsi-target with the following command:  
service iscsi-target restart

Return to Oracle Linux OS, restart iscsi service and make it start automatically every time the system is restart by following commands:
chkconfig --level 35 iscsi on
service iscsi restart

Again in Oracle Linux OS make iscsi discover manually and then automatically new created LUNs by the following commands:
iscsiadm -m discovery -t sendtargets -p 192.168.1.8
iscsiadm -m node -T iqn-asmdisk03 -p 192.168.1.8 –l 
iscsiadm -m node -T iqn-asmdisk03 -p 192.168.1.8 --op update -n node.startup -v automatic

If Oracle Linux can not discover new created LUNs try comment everything in Opnefiler:/etc/initiators.deny

Configure iSCSI disk devices for Oracle ASM with ASMLib
Partition the Disk Devices from Oracle Linux. Format these disks to contain a single primary partition to represent it at the time of creating ASM disk using oracleasm.Command is: 

fdisk /dev/sdb->n->1->p->default->default->w
fdisk /dev/sdc->n->1->p->default->default->w
fdisk /dev/sdd->n->1->p->default->default->w

Verified that the below RPMs are installed before configuring the ASM driver. (Refer to operating system package section at Step By Step: Installing Oracle 11g R2 on Oracle Enterprise Linux without GUI (Graphical User Interface) )

oracleasm-2.6.18-194.el5-2.0.5-1.el5 
oracleasm-support-2.1.3-1.el5 
oracleasm-2.6.18-194.el5xen-2.0.5-1.el5
oracleasm-2.6.18-194.el5PAE-2.0.5-1.el5
oracleasm-2.6.18-194.el5debug-2.0.5-1.el5
oracleasmlib-2.0.4-1.el5

Oracleasmlib-2.0.4-1.e15 is not found in downloaded iso file so it must be download explicitly (It can be download from this link).

Loaded the ASMLib Module:
oracleasm init

Created the ASM disks using oracleasm:
oracleasm createdisk DSK01 /dev/sdb1
oracleasm createdisk DSK02 /dev/sdc1
oracleasm createdisk DSK03 /dev/sdd1
oracleasm scandisks
oracleasm listdisks       

[root@home oracle]# oracleasm listdisks
DSK01
DSK02
DSK03

Installation of Grid Infrastructure  
In the Oracle 11g Release 2, the Grid Infrastructure is required to use Automatic Storage Management (ASM).

Copy the grid executables to Oracle Linux. This can be done by using Cygwin with the following command:
$ cd H:\\Meine\\Apps\\Oracle (Point to the location of grid in Windows host)
$ scp linux.x64_11gR2_grid.zip oracle@192.168.1.7:/home/oracle (Copy to Oracle Linux /home/oracle path)

In Oracle Linux unzip the file by below command:
unzip linux.x64_11gR2_grid.zip

Log in to Oracle Linux as oracle user. Set environmental variable DISPLAY=192.168.1.100:0.0 (windows host ip) at Oracle Linux. Start Cygwin x-window by startXwin command and add Oracle Linux to control list by issue xhost + 192.168.1.7. Then from Linux point to /home/oracle/grid folder and run ./runInstaller.

In the first window select  Install and Configure Grid Infrastructure for a Standalone Server


Selected language 


In the next window create ASM disks should be appear. Specify Disk Group Name (DATA), select redundancy as External and choose ORCL:DSK01


Use the same passwords for these accounts


Leave Operation System Groups as default and press Next


Leave Installation Location as default


Continue to Next after the reach of Finish button.



Log in as root and execute the below script


Last window from grid installation


  
Creation of Database
Log in to Oracle Linux as oracle user. Set environmental variable DISPLAY=192.168.1.100:0.0 (windows host ip) at Oracle Linux. Start Cygwin x-window and add Oracle Linux to control list by issue xhost + 192.168.1.7. Then from Linux point to Oracle bin folder and run ./netca for first configuring a listener and then run ./dbca for creation of database.

In step 6 of 12, as storage type must be choose Automatic Storage Management (ASM) as below:


Under UseOracle-Managed Files click Browse and then choose DATA in available disk groups


In next window do not specify flash recovery area. 

In next window check Sample Schema

Leave Initialization Parameters as default

Below is the summary

Create Database - Summary 
Database Configuration Summary 
Global Database Name: orcl.test.al 
Database Configuration Type: Oracle Restart Enabled Single Instance 
SID: orcl 
Management Option Type: Database Control Storage Type: Automatic Storage Management (ASM) Memory Configuration Type: Automatic Memory Management

Database is being creating\




If we open Enterprise Manager we see that database is up and running.


Hope you find these article helpful