Friday, December 31, 2010

Does open database really open?

Ra ra ra, the database has been created, then the tables were created, and even data was entered into the table. Ok, so now I want to shut this thing
down and see if it starts again.

OK, so I shutdown the database, then was about to issue a startup when I thought wait a minute does this thing really open any files when I say open
database.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.


SQL> startup mount;
ORACLE instance started.

Total System Global Area 2.6991E+10 bytes
Fixed Size                  2213976 bytes
Variable Size            1.7448E+10 bytes
Database Buffers         9395240960 bytes
Redo Buffers              145174528 bytes
Database mounted.
I then found out the process id (PID's) of the Database Writer process.

[root@isvx3 ~]#  ps -ef | grep dbw
oracle    9433     1  0 Dec22 ?        00:00:00 asm_dbw0_+ASM
oracle   32005     1  0 15:43 ?        00:00:00 ora_dbw0_abc
oracle   32007     1  0 15:43 ?        00:00:00 ora_dbw1_abc
oracle   32009     1  0 15:43 ?        00:00:00 ora_dbw2_abc
root     32039 31716  0 15:44 pts/3    00:00:00 grep dbw
Then straced one of the database writed process and collected the output in file.
[root@isvx3 ~]# strace -o /tmp/dbw.txt -p 32005 &
Then I issued the database open command at the sql prompt
SQL> alter database open;

Database altered.

SQL>
Now the moment of truth, Ta-Da....
-bash-3.2$ cat /tmp/dbw.txt | grep open
open("/proc/31987/stat", O_RDONLY)      = 18
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_system_6kt8jg4q_.dbf", O_RDONLY) = 18
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_system_6kt8jg4q_.dbf", O_RDONLY) = 18
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_system_6kt8jg4q_.dbf", O_RDWR|O_SYNC) = 18
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_sysaux_6kt8jg6r_.dbf", O_RDONLY) = 19
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_sysaux_6kt8jg6r_.dbf", O_RDONLY) = 19
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_sysaux_6kt8jg6r_.dbf", O_RDWR|O_SYNC) = 19
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_undotbs1_6kt8jg8b_.dbf", O_RDONLY) = 20
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_undotbs1_6kt8jg8b_.dbf", O_RDONLY) = 20
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_undotbs1_6kt8jg8b_.dbf", O_RDWR|O_SYNC) = 20
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_users_6kt8jgbw_.dbf", O_RDONLY) = 21
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_users_6kt8jgbw_.dbf", O_RDONLY) = 21
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_users_6kt8jgbw_.dbf", O_RDWR|O_SYNC) = 21
open("/u02/app/oracle/oradata/ABC/datafile/foo1.dbf", O_RDONLY) = 22
open("/u02/app/oracle/oradata/ABC/datafile/foo1.dbf", O_RDONLY) = 22
open("/u02/app/oracle/oradata/ABC/datafile/foo1.dbf", O_RDWR|O_SYNC) = 22
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_temp_6kt8lr7z_.tmp", O_RDONLY) = 23
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_temp_6kt8lr7z_.tmp", O_RDONLY) = 23
open("/u02/app/oracle/oradata/ABC/datafile/o1_mf_temp_6kt8lr7z_.tmp", O_RDWR|O_SYNC) = 23
open("/u02/app/oracle/product/11.2.0/dbhome_1/rdbms/mesg/oraus.msb", O_RDONLY) = 24
-bash-3.2$
We can see a list of all the files that were opened after open database was called at the sqlplus prompt.

The case of the missing table!!!

 Now that I had created a database 'abc' using dbca I decided to take create a little database to keep track of my favourite Bollywood movies.
-bash-3.2$ export ORACLE_SID=abc
-bash-3.2$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Dec 31 09:29:14 2010

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, OLAP, Data Mining and Real Application Testing options

SQL> create table movies (
  2  id number,
  3  movie_name varchar2(30),
  4  actor varchar2(30),
  5  actress varchar2(30),
  6  year_released number
  7  );

Table created.

SQL>

SQL> insert into movies
  2  values ( 1, 'Sholay', 'Amitabh Bachchan', 'Hema Malini', 1975);

1 row created.

SQL>
SQL> insert into movies
  2  values (2, 'Khilona', 'Sanjeev Kumar', 'Mumtaz', 1970);

1 row created.

SQL>
SQL> insert into movies
  2  values (3, 'Chupke Chupke', 'Dharamendar', 'Sharmila Tagore',1975);

1 row created.


So now I want to know my table was really created, and if so on what tablespace

SQL> select owner, table_name, tablespace_name   2  from dba_tables   3  where table_name='movies'; no rows selected SQL>

What??? Where is my table??? Well Ok, don't forget we are working with Oracle, and that would have been too easy.

SQL> select owner, table_name, tablespace_name
  2  from dba_tables
  3  where table_name='MOVIES';

OWNER                          TABLE_NAME
------------------------------ ------------------------------
TABLESPACE_NAME
------------------------------
SYS                            MOVIES
SYSTEM

Yes!!! It's bloody case sensitive. Now why would they do that, and even it was, why would Oracle not fix it. Don't
ask cause we are dealing with Oracle out here.

Anyroad, the table has been created and it's in the SYSTEM tablespace

SQL> select table_name, tablespace_name
  2  from user_tables
  3  where table_name = 'MOVIES';

TABLE_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
MOVIES                         SYSTEM

Thursday, December 30, 2010

It's never big enough!!!

Yeah! Yeah! I'm talking about the USER tablespace out here. I wanted my USER Tablespace to be big, bigger, biggest , so I decided to extend it's size by adding a datafile to it.

Ok, so should I create a file and then give it to the tablespace or should I just tell it to create one and add it to the USER tablespace. Well, I tried both methods.

Here I created a file foo2.dbf and used it to extend the tablespace. As we see it failed with an error message.


SQL> alter tablespace users add datafile '/u02/app/oracle/oradata/ABC/datafile/foo2.dbf' size 500M;
alter tablespace users add datafile '/u02/app/oracle/oradata/ABC/datafile/foo2.dbf' size 500M
*
ERROR at line 1:
ORA-01119: error in creating database file
'/u02/app/oracle/oradata/ABC/datafile/foo2.dbf'
ORA-27038: created file already exists
Additional information: 1


Next, I added the datafile with creating the file beforehand, and it worked fine.


SQL> alter tablespace users add datafile '/u02/app/oracle/oradata/ABC/datafile/foo1.dbf' size 500M;

Tablespace altered.

SQL> select file_name, tablespace_name from dba_data_files where tablespace_name='USERS';

FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME
------------------------------
/u02/app/oracle/oradata/ABC/datafile/o1_mf_users_6kt8jgbw_.dbf
USERS

/u02/app/oracle/oradata/ABC/datafile/foo1.dbf
USERS


SQL>


Moral of the story, you don't need to create the file in advance to extend tablespace. You just have to pass the file name along with the path, and the rest is taken care for you.

Tablespace and their underlying datafiles

Now that I know where the control, data and the redo log files of my database "abc" are, I'm now interested in getting some information about the tablespaces. After reading the reams and reams of our lovely Oracle documentation I now know that tablespace are made up of one of more datafiles.

I was to first find out what the names of the tablespaces are for my database "abc" created by Oracle dbca.

SQL> select name from v$tablespace;

NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
USERS
TEMP

Ok, now what are the files that are associated with these tablespaces.

SQL> select file_name, tablespace_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME
------------------------------
/u02/app/oracle/oradata/ABC/datafile/o1_mf_users_6kt8jgbw_.dbf
USERS

/u02/app/oracle/oradata/ABC/datafile/o1_mf_undotbs1_6kt8jg8b_.dbf
UNDOTBS1

/u02/app/oracle/oradata/ABC/datafile/o1_mf_sysaux_6kt8jg6r_.dbf
SYSAUX


FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME
------------------------------
/u02/app/oracle/oradata/ABC/datafile/o1_mf_system_6kt8jg4q_.dbf
SYSTEM


SQL>

Where are my control, data, and redo log files?

I used Oracle's dbca tool under $ORACLE_HOME/bin/dbca to create a database using the "General Purpose or Transactional Processing" template, which included the datafiles.

I used File system for the Storage Type, and used Oracle-Managed files for the storage location.

Database Area: $ORACLE_BASE/oradata

Flash Recovery Area: $ORACLE_BASE/flash_recovery_area

The server parameter file: $ORACLE_HOME /dbs/spfileabc.ora

-bash-3.2$ echo $ORACLE_HOME
/u02/app/oracle/product/11.2.0/dbhome_1
-bash-3.2$ echo $ORACLE_SID

-bash-3.2$ export ORACLE_SID=abc
-bash-3.2$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Dec 30 16:26:30 2010

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, OLAP, Data Mining and Real Application Testing options

SQL>
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u02/app/oracle/oradata/ABC/datafile/o1_mf_system_6kt8jg4q_.dbf
/u02/app/oracle/oradata/ABC/datafile/o1_mf_sysaux_6kt8jg6r_.dbf
/u02/app/oracle/oradata/ABC/datafile/o1_mf_undotbs1_6kt8jg8b_.dbf
/u02/app/oracle/oradata/ABC/datafile/o1_mf_users_6kt8jgbw_.dbf

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/u02/app/oracle/oradata/ABC/controlfile/o1_mf_6kt8lgnc_.ctl
/u02/app/oracle/flash_recovery_area/ABC/controlfile/o1_mf_6kt8lgxg_.ctl

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u02/app/oracle/oradata/ABC/onlinelog/o1_mf_3_6kt8lo0w_.log
/u02/app/oracle/flash_recovery_area/ABC/onlinelog/o1_mf_3_6kt8lomz_.log
/u02/app/oracle/oradata/ABC/onlinelog/o1_mf_2_6kt8lms1_.log
/u02/app/oracle/flash_recovery_area/ABC/onlinelog/o1_mf_2_6kt8lnf2_.log
/u02/app/oracle/oradata/ABC/onlinelog/o1_mf_1_6kt8lkp2_.log
/u02/app/oracle/flash_recovery_area/ABC/onlinelog/o1_mf_1_6kt8lm49_.log

6 rows selected.

SQL>

ORA-12162: TNS:net service name is incorrectly specified


-bash-3.2$ sqlplus / as sysdba;

SQL*Plus: Release 11.2.0.1.0 Production on Thu Dec 30 16:29:38 2010

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

ERROR:
ORA-12162: TNS:net service name is incorrectly specified


Enter user-name:


Yes, this is one of Oracle's friendly and useful error messages. It is so clear from the error message that as soon as we get it, we'll go and set ORACLE_SID to the name of our database and everything will work fine after that.

-bash-3.2$ export ORACLE_SID=abc
-bash-3.2$ sqlplus / as sysdba;

SQL*Plus: Release 11.2.0.1.0 Production on Thu Dec 30 16:34:22 2010

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, OLAP, Data Mining and Real Application Testing options

SQL>

Tuesday, December 21, 2010

fsck.ext3: No such file or directory while trying to open /dev/dm-1 [FAILED]


I was mucking around with my Storwize V7000 storage array that was connected to my Red Hat Linux server. Then I went back to my Red Hat server and started configuring couple of applications on it, and then rebooted the machine.

The boot process stopped, and I got the message:
Checking filesystems
fsck.ext3: No such file or directory while trying to open /dev/dm-1 [FAILED]
*** An error occurred during the file system check.
*** Dropping you to a shell; the system will reboot
*** when you leave the shell.
Give root password for maintainance
(or type Control-D to continue):

I realised  that in the processing of mucking around with the storage I had removed then volume(LUN) that I had created, and then mapped onto the Red Hat server. I had then created a ext3 file system on that volume.

It was this volume(LUN) that the boot process was complaining about.

To fix the issue, I logged into the machine in single user mode with my root password. The fix is rather straight forward, uncomment the mount point line in the /etc/fstab file.

You will see that you won't be able to do that, so what you need to do is mount / in read write mode.

#  mount -o remount,rw /

# vi /etc/fstab

comment out the line, and then reboot the machine. There you go, it's fixed!!!

Wednesday, November 24, 2010

Adding additional disk to an ASM Disk Group on a Linux host

I wanted to increase the size of the DATA ASM Disk Group, so I created some additional volumes vol05 on the Storwize V7000 and mapped them onto my RedHat Linux host.
The UID of the new volume vol05 that is created is 6005076802828000C000000000000054

I now want the Linux host to see the volume without doing a reboot of the system. To do that I follow the steps mentioned below.

To find the HBA Host ids for the system, do the following as root on the Linux system.

[root@isvx7 ~]#  ls /sys/class/fc_host
host5  host6

Scan the SCSI bus to detect the new volume. Run the below command on the Linux host that is attached to the storage system. There must be a space between each of the minus signs contained within the double quotes

[root@isvx7 ~]#  echo "- - -" > /sys/class/scsi_host/host5/scan
[root@isvx7 ~]#  echo "- - -" > /sys/class/scsi_host/host6/scan


[root@isvx7 ~]# multipath -d -l
mulipath.conf line 111, invalid keyword: prio
mpath145 (36005076802828000c000000000000054) dm-4 IBM,2145
[size=300G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
 \_ 5:0:0:4 sdah 66:16  [active][undef]
 \_ 5:0:1:4 sdai 66:32  [active][undef]
 \_ 5:0:2:4 sdaj 66:48  [active][undef]
 \_ 5:0:3:4 sdak 66:64  [active][undef]
 \_ 6:0:0:4 sdal 66:80  [active][undef]
 \_ 6:0:1:4 sdam 66:96  [active][undef]
 \_ 6:0:2:4 sdan 66:112 [active][undef]
 \_ 6:0:3:4 sdao 66:128 [active][undef]
mpath144 (36005076802828000c000000000000050) dm-3 IBM,2145
[size=300G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
 \_ 5:0:3:3 sdaf 65:240 [active][undef]
 \_ 6:0:3:3 sdag 66:0   [active][undef]
 \_ 5:0:0:3 sdh  8:112  [active][undef]
 \_ 6:0:0:3 sdi  8:128  [active][undef]
 \_ 6:0:1:3 sdp  8:240  [active][undef]
 \_ 5:0:1:3 sdq  65:0   [active][undef]
 \_ 5:0:2:3 sdx  65:112 [active][undef]
 \_ 6:0:2:3 sdy  65:128 [active][undef]
mpath143 (36005076802828000c000000000000053) dm-2 IBM,2145
[size=300G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
 \_ 5:0:3:2 sdad 65:208 [active][undef]
 \_ 6:0:3:2 sdae 65:224 [active][undef]
 \_ 5:0:0:2 sdf  8:80   [active][undef]
 \_ 6:0:0:2 sdg  8:96   [active][undef]
 \_ 5:0:1:2 sdn  8:208  [active][undef]
 \_ 6:0:1:2 sdo  8:224  [active][undef]
 \_ 5:0:2:2 sdv  65:80  [active][undef]
 \_ 6:0:2:2 sdw  65:96  [active][undef]
mpath142 (36005076802828000c000000000000052) dm-1 IBM,2145
[size=300G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
 \_ 5:0:3:1 sdab 65:176 [active][undef]
 \_ 6:0:3:1 sdac 65:192 [active][undef]
 \_ 5:0:0:1 sdc  8:32   [active][undef]
 \_ 6:0:0:1 sde  8:64   [active][undef]
 \_ 6:0:1:1 sdl  8:176  [active][undef]
 \_ 5:0:1:1 sdm  8:192  [active][undef]
 \_ 5:0:2:1 sdt  65:48  [active][undef]
 \_ 6:0:2:1 sdu  65:64  [active][undef]
mpath141 (36005076802828000c000000000000051) dm-0 IBM,2145
[size=300G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
 \_ 5:0:3:0 sdaa 65:160 [active][undef]
 \_ 5:0:0:0 sdb  8:16   [active][undef]
 \_ 6:0:0:0 sdd  8:48   [active][undef]
 \_ 6:0:1:0 sdj  8:144  [active][undef]
 \_ 5:0:1:0 sdk  8:160  [active][undef]
 \_ 6:0:2:0 sdr  65:16  [active][undef]
 \_ 5:0:2:0 sds  65:32  [active][undef]
 \_ 6:0:3:0 sdz  65:144 [active][undef]
[root@isvx7 ~]#
The volumes  mapath141, mpath142, mpath143, and mpath144 are already part of the ASM diskgroup +DATA.

[root@isvx7 ~]# ls -l /dev/mapper/
total 0
crw------- 1 root   root  10, 63 Sep 28 09:57 control
brw-rw---- 1 oracle dba  253,  0 Sep 29 14:17 mpath141
brw-rw---- 1 oracle dba  253,  1 Sep 29 14:14 mpath142
brw-rw---- 1 oracle dba  253,  2 Sep 29 14:17 mpath143
brw-rw---- 1 oracle dba  253,  3 Sep 29 14:16 mpath144
brw-rw---- 1 root   disk 253,  4 Sep 29 14:07 mpath145

Change the owner and group of mpath145 to oracle:dba

[root@isvx7 mapper]# chown -R oracle:dba mpath145
[root@isvx7 mapper]# ls -l /dev/mapper/
total 0
crw------- 1 root   root  10, 63 Sep 28 09:57 control
brw-rw---- 1 oracle dba  253,  0 Sep 29 14:19 mpath141
brw-rw---- 1 oracle dba  253,  1 Sep 29 14:19 mpath142
brw-rw---- 1 oracle dba  253,  2 Sep 29 14:19 mpath143
brw-rw---- 1 oracle dba  253,  3 Sep 29 14:19 mpath144
brw-rw---- 1 oracle dba  253,  4 Sep 29 14:07 mpath145

The shows the initial distribution of data between the volumes of the diskgroup.

SQL> select name, path, free_mb, total_mb from v$asm_disk;

NAME
------------------------------
PATH
--------------------------------------------------------------------------------
   FREE_MB   TOTAL_MB
---------- ----------

/dev/mapper/mpath145
         0          0

DATA_0003
/dev/mapper/mpath144
    155443     307200

NAME
------------------------------
PATH
--------------------------------------------------------------------------------
   FREE_MB   TOTAL_MB
---------- ----------

DATA_0002
/dev/mapper/mpath143
    155437     307200

DATA_0001
/dev/mapper/mpath142

NAME
------------------------------
PATH
--------------------------------------------------------------------------------
   FREE_MB   TOTAL_MB
---------- ----------
    155434     307200

DATA_0000
/dev/mapper/mpath141
    155438     307200


SQL>


Then using "asmca" I added the additional Storwize V7000 volumes to the DATA ASM Disk Group


After adding the v$asm_disk shows that the data in the volumes has been redistributed between the volumes.
As shown below we can see that /dev/mapper/mpath45 now has data on it. This took roughly 20 to 30 minutes.


SQL>  select name, path, free_mb, total_mb from v$asm_disk;

NAME
------------------------------
PATH
--------------------------------------------------------------------------------
   FREE_MB   TOTAL_MB
---------- ----------
DATA_0003
/dev/mapper/mpath144
    185789     307200

DATA_0002
/dev/mapper/mpath143
    185789     307200

NAME
------------------------------
PATH
--------------------------------------------------------------------------------
   FREE_MB   TOTAL_MB
---------- ----------

DATA_0001
/dev/mapper/mpath142
    185789     307200

DATA_0000
/dev/mapper/mpath141

NAME
------------------------------
PATH
--------------------------------------------------------------------------------
   FREE_MB   TOTAL_MB
---------- ----------
    185789     307200

DATA_0004
/dev/mapper/mpath145
    185792     307200


SQL>

Tuesday, November 23, 2010

Creating ASM Disk Group with the remaining volumes of the Storwize V7000

In the last post I had used 4 of the volumes to create an ASM Disk Group called DATA. In this post I'm going to use the remaining 2 volumes to create another ASM Disk Group call LOG.

First I'll change the ownership of the volumes to oracle, and group to dba:
[root@isvx3 ~]# chown -R oracle:dba /dev/mapper/mpath4
[root@isvx3 ~]# chown -R oracle:dba /dev/mapper/mpath5

I'll use asmca, a utility that is part of the Oracle 11g R2 grid infrastructure to create the ASM Disk Group
-bash-3.2$ echo $GRID_HOME
/u02/app/oracle/product/11.2.0/grid
-bash-3.2$ $GRID_HOME/bin/asmca


I'm now going to quickly verify if the ASM Disk Group was created properly:





-bash-3.2$ $ORACLE_HOME/bin/asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576   2048000  2047803               50         1023876              0             N  DATA/
MOUNTED  NORMAL  N         512   4096  1048576   1024000  1023886                0          511943              0             N  LOG/

ATTENTION:
Just when everything looked fine, I thought that I should try a reboot and see how things hold up.
After the reboot, the Linux host came up and I ran the "asmcmd lsdg" and this is what I observer.
-bash-3.2$ $ORACLE_HOME/bin/asmcmd lsdg
-bash-3.2$

Yes, nulla, zot, nothing is what I saw.
-bash-3.2$ $ORACLE_HOME/bin/asmcmd lsdg
-bash-3.2$

In the Oracle docs "Oracle® Database Installation Guide11g Release 2 (11.2) for Linux E16763-06 " it says
"The O_DIRECT parameter enables direct read and writes to block devices, avoiding
kernel overhead. With Oracle Database Release 10.2 and later, Oracle Database files are
configured by default to use direct input/output.
With the 2. 6 kernel or later for Red Hat Enterprise Linux, Oracle Linux, and SUSE
Enterprise Server, you must create a permissions file to maintain permissions on
Oracle database files. If you do not create this permissions file, then permissions on
disk devices revert to their default values, root:disk, and Oracle database fails to
start."

I quick and easy way to workaround this issue is to add the following to the /etc/rc.local file
chown oracle:dba /dev/mapper/mpath*
chmod 600 /dev/mapper/mpath*

A more permanent fix would be to add the permission file as shown in the link below:
http://download.oracle.com/docs/cd/B28359_01/install.111/b32002/pre_install.htm#CDEBHDCD




Mapping Storage Array(SAN) Volumes to RedHat 5.5 Linux host

I created 6 volumes on my Storwize V7000 Storage Array, and mapped them to my RedHat Linux 5.5 host. Each volume that I created has a unique UID assigned to it eg. vol01 has UID 60050768018103ABF000000000000001, while vol02 has UID 60050768018103ABF000000000000002 and so on.


Find the HBA host ids of the Linux system.
[root@isvx3 ~]# ls /sys/class/fc_host
host5  host6

Next scan the SCSI but to detect the new volumes.
[root@isvx3 ~]# echo "- - -" > /sys/class/scsi_host/host5/scan
[root@isvx3 ~]# echo "- - -" > /sys/class/scsi_host/host6/scan

On my linux host side I enabled the native multipathing(Device Mapper-Multipath). Now on doing "multipath -d -l" from the command line I see the following:
[root@isvx3 vdbench]# multipath -d -l
mpath1 (3600507680192828b8800000000000002) dm-3 IBM,2145
[size=250G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
 \_ 6:0:4:0 sdad 65:208 [active][undef]
 \_ 6:0:5:0 sdae 65:224 [active][undef]
 \_ 6:0:6:0 sdaf 65:240 [active][undef]
 \_ 6:0:7:0 sdag 66:0   [active][undef]
 \_ 5:0:4:0 sdn  8:208  [active][undef]
 \_ 5:0:5:0 sdo  8:224  [active][undef]
 \_ 5:0:6:0 sdp  8:240  [active][undef]
 \_ 5:0:7:0 sdq  65:0   [active][undef]
mpath9 (360050768018103abf000000000000006) dm-2 IBM,2145
[size=500G][features=1 queue_if_no_path][hwhandler=0][rw] \_ round-robin 0 [prio=0][active]  \_ 6:0:1:5 sdac 65:192 [active][undef]  \_ 5:0:0:5 sdg  8:96   [active][undef]  \_ 5:0:1:5 sdm  8:192  [active][undef]  \_ 6:0:0:5 sdw  65:96  [active][undef]
mpath8 (360050768018103abf000000000000001) dm-1 IBM,2145
[size=500G][features=1 queue_if_no_path][hwhandler=0][rw] \_ round-robin 0 [prio=0][active]  \_ 6:0:1:4 sdab 65:176 [active][undef]  \_ 5:0:0:4 sdf  8:80   [active][undef]  \_ 5:0:1:4 sdl  8:176  [active][undef]  \_ 6:0:0:4 sdv  65:80  [active][undef]
mpath7 (360050768018103abf000000000000005) dm-0 IBM,2145
[size=500G][features=1 queue_if_no_path][hwhandler=0][rw] \_ round-robin 0 [prio=0][active]  \_ 6:0:1:3 sdaa 65:160 [active][undef]  \_ 5:0:0:3 sde  8:64   [active][undef]  \_ 5:0:1:3 sdk  8:160  [active][undef]  \_ 6:0:0:3 sdu  65:64  [active][undef]
mpath6 (360050768018103abf000000000000004) dm-6 IBM,2145
[size=500G][features=1 queue_if_no_path][hwhandler=0][rw] \_ round-robin 0 [prio=0][active]  \_ 5:0:0:2 sdd  8:48   [active][undef]  \_ 5:0:1:2 sdj  8:144  [active][undef]  \_ 6:0:0:2 sdt  65:48  [active][undef]  \_ 6:0:1:2 sdz  65:144 [active][undef]
mpath5 (360050768018103abf000000000000003) dm-5 IBM,2145
[size=500G][features=1 queue_if_no_path][hwhandler=0][rw] \_ round-robin 0 [prio=0][active]  \_ 5:0:0:1 sdc  8:32   [active][undef]  \_ 5:0:1:1 sdi  8:128  [active][undef]  \_ 6:0:0:1 sds  65:32  [active][undef]  \_ 6:0:1:1 sdy  65:128 [active][undef]
mpath4 (360050768018103abf000000000000002) dm-4 IBM,2145
[size=500G][features=1 queue_if_no_path][hwhandler=0][rw] \_ round-robin 0 [prio=0][active]  \_ 5:0:0:0 sdb  8:16   [active][undef]  \_ 5:0:1:0 sdh  8:112  [active][undef]  \_ 6:0:0:0 sdr  65:16  [active][undef]  \_ 6:0:1:0 sdx  65:112 [active][undef] [root@isvx3 vdbench]#

From this we can see that volume vol01 maps to dm-1, vol02 to dm-4, vol03 to dm-5, vol04 to dm-6, vol05 to dm-0, and vol06 to dm-2

After changing the owner and group of the volumes to oracle and dba:
[root@isvx3 ~]# chown -R oracle:dba /dev/mapper/mpath6
[root@isvx3 ~]# chown -R oracle:dba /dev/mapper/mpath7
[root@isvx3 ~]# chown -R oracle:dba /dev/mapper/mpath8
[root@isvx3 ~]# chown -R oracle:dba /dev/mapper/mpath9
I then used 4 of these volumes to create an Oracle ASM Disk Group during my 11g R2 Grid Infrastructure installation.

Monday, November 22, 2010

Upgrading from Java version 1.4.2 to 1.6.0 on RedHat Linux

I was planning on running vdbench to get some performance numbers for the IBM Storwize V7000. I installed vdbench, and then decided to bring up it's GUI with the ./vdbench -gui command, that is when it told me that the Java version on my RedHat Linux machine was1.4 , and that I need to update it to 1.5 or a later version.

I downloaded Java from http://www.java.com/en/download/help/5000011400.xml  and installed 1.6 under /usr/java

The current java on my RedHat host machine was linked to:
[root@isvx3 bin]# ls -l /usr/bin/javalrwxrwxrwx 1 root root 22 Nov 22 12:42 /usr/bin/java -> /etc/alternatives/java
[root@isvx3 java]#java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-48)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root@isvx3 java]#




I removed that link:
[root@isvx3 bin]# rm /usr/bin/java
rm: remove symbolic link `/usr/bin/java'? y


Re-linked the jre1.6 which I had installed under /usr/java:
[root@isvx3 bin]# ln -s /usr/java/jre1.6.0_22/bin/java /usr/bin/java
[root@isvx3 bin]# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 30 Nov 22 13:01 /usr/bin/java -> /usr/java/jre1.6.0_22/bin/java




Check to see if the Java version has been updated:
[root@isvx3 bin]# which java
/usr/bin/java
[root@isvx3 bin]# java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)
[root@isvx3 bin]#