Raw devices mapping inconsistent

Raw devices mapping gets changed each time service iscsi is restarted . or node is restarted
udev has been configured using these scripts.
nas configured using openfiler
55-openiscsi.rules
KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/%part%"
iscsidev.sh
#!/bin/sh
# FILE: /etc/udev/scripts/iscsidev.sh
BUS=${1}
HOST=${BUS%%:*}
[ -e /sys/class/iscsi_host ] || exit 1
file="/sys/class/iscsi_host/host*/device/session*/iscsi_session*/targetname"
target_name=$(cat ${file})
# This is not an open-scsi drive
if [ -z "${target_name}" ]; then
exit 1
fi
echo "${target_name##*.}"
Please suggest.

Hi,
To find how raw devices are being mapped to phsyical device run this command /usr/sbin/lspv | grep -i
for example # /usr/sbin/lspv | grep -i "0009005fb9c23648"
see this link
http://download.oracle.com/docs/cd/B28359_01/install.111/b28258/storage.htm#CDEJFCCB

Similar Messages

  • Raw device mapping

    accidentally we lost the rawdevice mapping file /etc/sysconfig/rawdevices. since we do not have OS backup we could not restore this file.
    without this file ASM could not mount diskgroups....
    Is it possible to find the device mapping from anykind of OS or Oracle Log/Trace files?
    Oracle alert log contains only /dev/raw/raw1....

    Hi,
    If the raw devices are still bound to the block device and you haven't rebooted since you lost you rawdevices config file then you could identify the major/minor numbers using /usr/bin/raw -qa
    The example below shows that dev/raw/raw1 is bound to /dev/sdb1
    [root@foo]# raw -qa
    /dev/raw/raw1: bound to major 8, minor 17
    [root@rmukvm214 dev]# ls -l sdb1
    brw-rw---- 1 root disk 8, 17 Jun 17 16:14 sdb1
    I'm not sure if this is the most elegant or safest way of piecing this information back together, as mentioned you might want to raise an SR with Oracle support.
    Regards

  • ASMlib raw device mapping

    We're using ASMlib here, and I'm trying to figure out which raw devices were mapped to which ASM disks. From the installation instructions, our disks must have been created using the "/etc/init.d/oracleasm createdisk VOL1 /dev/sdg1
    " command mentioned on Oracle's main site. However the commands to query disks don't seem to provide that link.
    For instance the following command:
    /etc/init.d/oracleasm querydisk /dev/sdg1
    Will tell you if that device is indeed and ASM disk, but it won't tell you which label it maps to. Similarly
    /etc/init.d/oracleasm querydisk VOL1
    will tell you that the disk with that label is an ASM disk, but won't tell you which raw device it maps to. The reason I'm asking about this is myself and the sysadmins are trying to map our ASM disks back to the raw devices and from there back to the luns. This obviously wasn't documented at the time the disks were created, long before I started working at my current company. We can go from databases to disk groups and from disk groups to ASM devices, but we can't get from ASM device labels to the raw device names which would allow us to go backwards to the luns.
    Thanks!

    me too...
    #/etc/init.d/oracleasm querydisk /dev/sdc5
    Disk "/dev/sdc5" is marked an ASM disk with the label "VOL1"
    I still find device name from major and minor:
    #/etc/init.d/oracleasm querydisk VOL1
    Disk "VOL1" is a valid ASM disk on device \[8, 37\]
    #ls -l /dev/* | grep 8, | grep 37
    brw-rw---- 1 root disk 8, 37 Jul 31 17:48 /dev/sdc5
    Script:
    #!/bin/sh
    if \[ $# -ne 1 \]
    then
    echo "Please Check arguments."
    echo
    echo "./getasmlib \[label\]"
    echo
    echo " ./getasmlib VOL01"
    exit 0
    fi
    LABEL=$1
    C=`/etc/init.d/oracleasm querydisk ${LABEL} |grep valid |wc -l`
    if \[ ${C} -eq 0 \]
    then
    echo "Don't Found ${LABEL} Disk in ASMLIB"
    exit 0
    fi
    M=`/etc/init.d/oracleasm querydisk ${LABEL} | awk -F [ '{print $2 }' | awk '{print $1}'`
    N=`/etc/init.d/oracleasm querydisk ${LABEL} | awk -F , '{print $2 }' | awk -F ] '{print $1}'`
    for x in ` ls -l /dev/* | grep ${M} | grep ${N} | awk '{print $10}' `
    do
    /etc/init.d/oracleasm querydisk $x |grep ${LABEL}
    done
    # ./getasmlib VOL1
    Disk "/dev/sdc5" is marked an ASM disk with the label "VOL1"
    Good Luck

  • Raw devices problem

    Hello, I made a model on Vmware ESX for testing Oracle RAC, so it's two Centos 5.10 machines with shared disks. I'm using raw devices for ocr, voting disks and data, and without ASMLib library.
    After installing clusterware and Oracle (10gR2), everything was OK until now, when after reboot of one node, no more shared disks exist anymore. For every raw disk related comand I got an error:
    #raw -qa
    Cannot open raw device '/dev/rawctl' (No such file or directory)
    #service rawdevices restart
    Assigning raw devices:
    /dev/raw/raw1 --> /dev/sdb1
    Cannot open raw device '/dev/rawctl' (No such file or directory)
    Didn't find anything related to this in /var/log's. Could be glad if someone could explain how to fix it.

    Yes, but keep in mind that the device tree is not only rebuild after a system restart, but also the order of devices can be different, so for instance /dev/sdc1 may not be the same after a system restart if you attach or remove another device or plug in any USB. That's why UDEV should be configured to use the unique device identifier to map storage devices which require persistent device naming.
    For instance you could use the following entry to map e.g. current /dev/sdc1 to /dev/vote1
    KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id", RESULT=="361a98001686f6959614a453133524171", NAME="vote1", OWNER="oracle", GROUP="oinstall", MODE="0640"
    Using raw devices is no longer necessary, not for Oracle, which uses the O_DIRECT flag when opening a device and it does not matter if it is a device or partition. But if you really want to map to raw device names, you could use the following:
    ACTION=="add", KERNEL=="sd*", PROGRAM=="/sbin/scsi_id", RESULT=="361a98001686f6959614a453133524171", RUN+="/bin/raw /dev/raw/raw1 %N"

  • Raw device for red hat

    Hi,
    I tried to install raw device on red hat 4.2.I posted the mount point of that machine
    ]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
    145G 9.6G 128G 7% /
    /dev/sda1 99M 13M 82M 14% /boot
    none 2.0G 0 2.0G 0% /dev/shm
    /dev/sdb1 459G 350G 86G 81% */ydev*
    is it possible to use /ydev for the RAW mount point *.If it's,is it afffect any existing applications at dev?*
    please help me out that

    All that is required from a system level are partitioned disks. Oracle will handle the configuration of the filesystem. Here are my steps to configure raw devices using LUNs:
    --- PARTITION THE RAW VOLUMES ---
    fdisk /dev/<disk>
    Command (m for help): n
    Command action
    e extended
    p primary partition (1-4)
    p
    Partition number (1-4): 1
    First cylinder (1-512, default 1):<enter>
    Using default value 1
    Last cylinder or size or sizeM or +sizeK (1-512, default 512): >
    Using default value 512
    Command (m for help): w
    The partition table has been altered!
    Calling ioctl() to re-read partition table.
    Syncing disks.
    --- BIND PARTITIONS TO RAW DEVICES ---
    Edit /etc/udev/rules.d/60-raw.rules and add:
    # Define mapping of SCSI hard disks for Oracle Raw Devices
    ACTION=="add", KERNEL=="sdg1", RUN+="/bin/raw /dev/raw/raw1 %N"
    ACTION=="add", KERNEL=="sdj1", RUN+="/bin/raw /dev/raw/raw2 %N"
    ACTION=="add", KERNEL=="sdk1", RUN+="/bin/raw /dev/raw/raw3 %N"
    # Define persistent raw device permissions
    ACTION=="add", KERNEL=="raw*", OWNER=="oracle", GROUP=="dba", MODE=="0660"
    --- CREATE THE RAW DEVICES ---
    /sbin/start_udev
    --- VERIFY RAW DEVICES ---
    raw -qa
    2.     Update permissions of new devices
    chown -R oracle:dba /dev/<disks>
    3.     Create links to device on /dev/oracle
    # DETERMINE SCSI LINKS TO DEVICES
    clear ; ls -la /dev/disk/by-id/ | grep sd[f-v]1 | awk '{print $11,$9}'| sort
    # CREATE VOLUME MEMBER SYMBOLIC LINKS. DONE!

  • IS RAW DEVICES SUPPORTED OVER A CLUSTER FILE SYSTEM

    Can raw partions be defined for datafiles after having choosen Cluster file system as storage option for database while creating fresh database using
    DBCA?

    > Do update on how the partitions have to be defined in either cases?
    For both ASM and OCFS, a partition must exist on the disk - it can be of any partition type. Does not matter. Simply that the s/w references a partition and not an entire disk.
    So for example, /dev/sdaf and dev/sdag are two shared devices on the cluster (LUNs on the SAN or whatever).
    You create a partition on each. E.g
    # fdisk -l /dev/sdaf
    Disk /dev/sdaf: 36.5 GB, 36573020160 bytes
    255 heads, 63 sectors/track, 4446 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Device Boot Start End Blocks Id System
    /dev/sdaf1 1 4446 35712463+ 83 LinuxTo use the first device as a OCFS device, you need to build an ocfs file system on it using mkfs.
    And then it can be mounted as a "normal" cooked file system mount. Remember that /etc/fstab needs to be updated for mounting it on startup.
    To use the second device for ASM, you have two choices. If you have the ASMlib kernel module installed, you can use that to configure a volume label and assign it for use by ASM.
    Alternatively, you simply map the device (partition) to a raw device for detection by ASM. E.g.
    # raw /dev/raw/raw1 /dev/sdag1Of course, you also need to make this permanent by updating the raw device list config file so that this mapping is performed on reboot. On Linux, this is the /etc/sysconfig/rawdevices file. Also remember that the user and group access for the logical raw device created, must allow ASM full access to it (e.g. use chmod oracle.dba /dev/raw/raw1).
    In a nutshell, this is how to raw devices are used as ocfs and asm volumes. (on RHEL specifically, but I expect no major differences in this approach on other o/s's)

  • How can I copy datafile (from one Raw device) to another Raw device ???

    can anybody tell me how do i copy/move one datafile from one raw device to another raw device.... ?
    I am having AIX 5.3 with SAN.
    Pls. help me...
    regards,
    Star Nirav

    Hello Hans,
    Currently I am using via RMAN... Want to know which one help me....? Is there any size limitation via dd command ? Can I use iocopy instead of dd in AIX ?
    man dd

  • Raw device for oracle 8.1.7 on AIX 4.3.3

    Hi there,
    I am trying to use a raw device on AIX 4.3.3 for ORACLE 8.1.7.
    I have created a raw device /dev/or_system
    brw-rw---- 1 oracle dba 54, 1 Mar 04 10:44 or_system
    but it is not possible to create a datafile on it :
    SVRMGR> create database "GLM"
    maxinstances 8
    character set "WE8ISO8859P1"
    datafile '/dev/or_system' size 150M REUSE
    logfile
    GROUP 1 ('/oracle/GLM/redo/log1.ora') size 100M,
    GROUP 2 ('/oracle/GLM/redo/log2.ora') size 100M,
    GROUP 3 ('/oracle/GLM/redo/log3.ora') size 100M,
    GROUP 4 ('/oracle/GLM/redo/log4.ora') size 100M;
    create database "GLM"
    ORA-01501: CREATE DATABASE failed
    ORA-01519: error while processing file '?/rdbms/admin/sql.bsq' near line 407
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01119: error in creating database file '/dev/or_system'
    ORA-27038: skgfrcre: file exists
    SVRMGR>
    The ORA-27028 in exact this situation was reported as a bug in prior ORACLE Versions 8.0.4/ 8.0.5 and had
    the bug no. 690228.
    But we use as mentioned 8.1.7.
    What do I do wrong?
    Any suggestions are welcome.
    Thank you
    Gerhard

    Each raw device you create is used as a single data file.
    Eg mklv -y 'myfile' <vgname> <number of logical partitians>
    Will have two special files associated with them /dev/rmyfile and /dev/myfile. The number of logical partitians will be the size of your datafile subtract 1 meg for overhead.
    So, if you were addding the above raw volume to a tablespace, and the lp size was 32 meg, you would
    create tabelspace tsname datafile '/dev/rmyfile' size 31 m;
    Note the use of rmyfile not myfile.

  • Is this a bug in APEX 3.0.1 Installation  RAC database with RAW device???

    Hello,
    I am getting the following error when I try to complete approval process.
    ORA-20001: Unable to create tablespace. ORA-01
    119: error in creating database file '//./FLOW_1.dbf' ORA-27040: skgfrcre: creat
    e error, unable to create file OSD-04002: unable to open file O/S-Error: (OS 2)
    The system cannot find the file specified.
    I checked the alert log for error here is the error in the alert log file.
    ORA-1119 signalled during: CREATE TABLESPACE FLOW_1 DATAFILE '//./FLOW_1.dbf'..
    and i found the syntax for create tablespace was wrong.
    To create a tablespace in RAC with RAW device environment under windows.
    it should have forward black slash instead of backward slash "/" without .dbf extension.
    so, I changed the syntax i was able to create tablespace through sqlplus.
    When APEX tool try to create this tablespace it throws this error..
    Old: CREATE TABLESPACE FLOW_1 DATAFILE
    '\\.\FLOW_1.dbf' SIZE 10304 K REUSE AUTOEXTEND OFF
    EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO
    error : ORA-01119: error in creating database file '\\.\FLOW_1.dbf'
    New:
    CREATE TABLESPACE FLOW_1 DATAFILE
    '\\.\FLOW_1' SIZE 10304 K REUSE AUTOEXTEND OFF
    EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO
    Tablespace created.
    Is it a bug in APEX 3.0.1.??
    Is anyone installed APEX in RAC ??
    James

    Hi,
    One observation, Apex is switching the Session ID after one got killed ? I was working on Apex page with browse Item to test open cursor count,
    after killing the SID (227) on which the open cursor count was getting increase, it APEX automatically switches to new SID(149) for that session.
    Now the problem is even if I have two SID's and one hits the maximum open cursor count, It is not switching to other SID instead the whole application becomes unavailable.
    STATNAME SID VALUE USER
    opened cursors current 20 14 APEX_PUBLIC_USER
    opened cursors current 149 74 APEX_PUBLIC_USER
    opened cursors current 194 71 APEX_PUBLIC_USER
    opened cursors current 211 5 APEX_PUBLIC_USER
    opened cursors current 227 325 APEX_PUBLIC_USER Killed
    opened cursors current 244 15 APEX_PUBLIC_USER
    opened cursors current 20 14 APEX_PUBLIC_USER
    opened cursors current 149 76 APEX_PUBLIC_USER
    opened cursors current 194 71 APEX_PUBLIC_USER
    opened cursors current 211 5 APEX_PUBLIC_USER
    opened cursors current 244 15 APEX_PUBLIC_USER
    Please kindly help in this.
    Thanks in Advance
    Thanks & Regards
    Sanjay
    Edited by: user11204334 on Dec 8, 2010 1:02 AM

  • 10g ASM on Logical Volumes vs. Raw devices and SAN Virtualization

    We are looking at setting up our standards for Oracle 10g non-rac systems. We are looking at the value of Oracle ASM in our environment.
    As per the official Oracle documentation, raw devices are preferred to using Logical Volumes when using ASM.
    From here: http://download.oracle.com/docs/cd/B19306_01/server.102/b15658/appa_aix.htm#sthr
    ef723
    "Note: Do not add logical volumes to Automatic Storage Management disk groups. Automatic Storage Management works best when you add raw disk devices to disk groups. If you are using Automatic Storage Management, then do not use LVM for striping. Automatic Storage Management implements striping and mirroring."
    Also, as per Metalink note 452924.1:
    "10) Avoid using a Logical Volume Manager (LVM) because an LVM would be redundant."
    The issue is: if we use raw disk devices presented to ASM, the disks don't show up as used in the unix/AIX system tools (i.e. smit, lspv, etc.). Hence, when looking for raw devices on the system to add to filesystems/volume groups/etc., it's highly possible that a UNIX admin will grab a raw device that is already in use by Oracle ASM.
    Additionally, we are using a an IBM DS8300 SAN with IBM SAN Volume Controller (SVC) in front of it. Hence, we already have storage virtualization and I/O balancing at the SAN/hardware level.
    I'm looking for a little clarification to the following questions, as my understanding of their responses seem to confict:
    QUESTION #1: Can anyone clarify/provide additional detail as to why Logical volumes are not preferred when using Oracle ASM? Does the argument still hold in a SAN Virtualized environment?
    QUESTION #2: Does virtualization at the software level (ASM) make sense in our environment? As we already have I/O balancing provided at the hardware level via our SVC, what do we gain by adding yet another level of I/O balancing at the ASM level? Or as in the
    arguments the Oracle documentation makes against using Lvm, is this an unnecessary redundant striping (double-striped or in our case triple-striped/plaid)?
    QUESTION #3: So does SAN Virtualization conflict or compliment the virtualization provided by ASM?

    After more research/discussions/SR's, I've come to the following conclusion.
    Basically, in an intelligent storage environment (i.e. SVC), you're not getting a 100% bang for the buck by using ASM. Which is the cat's meow in a commodity hardware/unintelligent storage environment.
    Using ASM in a SVC environment potentially wastes CPU cycles having ASM balance i/o that is already balanced on the backend (sure if you shuffle a deck of cards that are already shuffled you're not doing any harm, but if they're already shuffled - then why are you shuffling them again??).
    That being said, there may still be some value for using ASM from the standpoint of storage management for multiple instances on a server. For example, one could better minimize space wastage by being able to share a "pool" of storage between mulitiple instances, rather than having to manage space on an instance-by-instance (or filesystem by filesystem) level.
    Also, in the case of having a unfriendly OS where one is unable to dynamically grow a filesystem (i.e. database outage required), there would be a definite benefit provided by ASM in being able to dynamically allocate disks to the "pool". Of course, with most higher-end end systems, dynamic filesystem growth is pretty much a given.
    In the case of RAC, regardless of the backend, ASM with raw is a no-brainer.
    In the case of a standalone instance, it's a judgement call. My vote in the case of intelligent storage where one could dynamically grow filesystems, would be to keep ASM out of the picture.
    Your vote may be different....just make sure you're putting in a solution to a problem and not a solution that's looking for a problem(s).
    And there's the whole culture of IT thing as well (i.e. do your storage guys know what you're doing and vice versa).....which can destroy any technological solution, regardless of how great it is.

  • How to setup the raw devices  permissions permanantly in 11gr2  on RHEL 5.

    Hi All,
    Succesfully installed 11gr2 RAC and working fine , but in next boot raw devices permissions revert back to root .
    Please advice me to how to setup permissions permanantly as the oracle user.
    Regards
    San
    .

    you find the lib on this page:
    http://www.oracle.com/technetwork/topics/linux/downloads/rhel5-084877.html
    in the AMD64 / Intel em64t Architecture table
    this is the direct link
    http://oss.oracle.com/projects/oracleasm/dist/files/RPMS/rhel5/amd64/2.0.5/2.6.18-194.el5/oracleasm-2.6.18-194.el5xen-2.0.5-1.el5.x86_64.rpm
    hth
    p.s. don't forget to mark question as helpful/correct and close the question.

  • How to create DIR/File on a raw device in RAC environment.

    Hi all,
    I use a shell script to create DIR and File on a raw device also it creates schema and tablespaces.
    I am facing problem in creating DIR and Files on raw device.
    One more thing, can multiple tablespaces be created on a raw device.
    Thanks & regards,
    Sanjeev

    Thanks for the response. Please help me further.
    About the Script - It asks for the path for creating DIR and uses shell command to create DIR. Later same path and DIR name is used to create Oracle DIR. Now in place of absolute path raw device name is passed. The same script is also used for creating tablespaces and schema.
    There is second script that is .sql script that creates external table in the newly created schema. All this has been working fine on single instance Oracle server. we have tested many times but fails in RAC environment when we use raw device.
    Question is - If I use filesystem will the external table's flat files and Directories be accessible to all the instances.
    I have one application written in java that would be clustered and running on these oracle servers. This application would be accessing those external tables and their flat files. Will there be a problem accessing these flat files accross the instances.
    Regards,
    Sanjeev.

  • CREATING RAW DEVICE IN LINUX

    HI ALL,
    in redhat linux 5 how to format the disk(ex: /opt,/u01,.....) and make it as raw device for ASM installation

    DSP_863977 wrote:
    HI ALL,
    in redhat linux 5 how to format the disk(ex: /opt,/u01,.....) and make it as raw device for ASM installationit is not possible to change a mount /opt or /u01 for ASM storage.
    for learning purpose you can learn with vmware server to create a raw device to configure/install ASM.
    Refer the link:- shared storage part for linux5/rhel5
    http://oracleinstance.blogspot.com/2010/03/oracle-10g-installation-in-linux-5.html
    for more information refer the link:-
    http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/asmprepare.htm

  • Content Server 6.40 on Raw Devices

    Hi Folks!
    We'd like to install a Content Server 6.40 using raw devices (on Linux Suse SLES9).
    Do we need to install the MaxDB, if we use raw devices? At this point the InstGuide does not give a clear description of what to do. It looks we can use the raw devices directly without having a database instance. Is this right?
    Is there any disadvantage compared to using the access via file system and DB?
    Any hint is appreciated...
    Best regards
    Torsten

    Hi Torsten,
    As far as i know SAP Content Server use MaxDB or a File System, I have use it with MaxDB with good results, anyhow.... read the following for details,
    http://help.sap.com/saphelp_nw04s/helpdata/en/40/32104211625933e10000000a155106/content.htm
    Regards
    Juan
    Please reward with points if helpdul

  • Using raw device

    Good morning,
    I would like to make some i/o test with a database version 10g, actually I have the redo log on standard zfs filesystem (cooked), I would like to
    migrate this redo log on raw device without recreating the database, is this possible ?
    Thanks for your help
    Fabrice Chapuis

    One more question, in case of node failure , redo on raw device are more critical for a recover than if they were on a filesystem ?More critical? Or more difficult?
    Redo is critical, period. Does not matter whether you use a cooked file system or a raw device.
    As for difficulty - that depends on what you are attempting to do. If you want to treat the raw device as a file system, that will be difficult as it it not a file system. (which kind of begs the question as to treat it like a file system when it is not?)
    From a RMAN perspective - a device is a device. RMAN does not care.
    From a DB perspective - that is why ASM exist. To remove the complexities of using raw devices, and eliminate the requirement of needing to use an external Volume Manager. And provide the DBA with a familiar SQL*Plus interface and SQL commands to administer ASM.
    It may seem difficult at first - but anything that needs a learning curve to go through, tends to seem difficult in the beginning. All you need to do is learn the basics and grasp the concepts.. and that +"difficulty"+ disappears.

Maybe you are looking for