Oracle uses raw via lvm

Source: Internet
Author: User

Oracle used raw via lvm to handle raw usage issues for a production database of another company in the morning. On-site staff said they would use the new lvm space for oracle, and lv had already been made, the ing is also bound, but raw is not visible all the time. After checking the relevant binding rule parameters and binding the rules in use, the new rules are copied and slightly modified, but it does not take effect. The following is the test process. [Root @ o564gtser1 ~] # Fdisk-l Disk/dev/sdd: 524 MB, 524288000 bytes 255 heads, 63 sectors/track, 63 cylinders Units = cylinders of 16065*512 = 8225280 bytes Disk/dev/sdd doesn't contain a valid partition table [root @ o564gtser1 ~] # Fdisk/dev/sdd Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. changes will remain in memory only, until you decide to write them. after that, of course, the previous content won't be recoverable. warning: invalid flag 0x0000 of partition table 4 will be corrected by w (rite) Command (m for help): n Command action e extended p primar Y partition (1-4) p Partition number (1-4): 1 First cylinder (1-63, default 1 ): using default value 1 Last cylinder or + size or + sizeM or + sizeK (1-63, default 63): Using default value 63 Command (m for help ): w The partition table has been altered! Calling ioctl () to re-read partition table. Syncing disks. [root @ o564gtser1 ~] # Pvcreate/dev/sdd1 Physical volume "/dev/sdd1" successfully created [root @ o564gtser1 ~] # Pvs pv vg Fmt Attr PSize PFree/dev/sdd1 lvm2 a-494.16 M 494.16 M [root @ o564gtser1 ~] # Pvdisplay "/dev/sdd1" is a new physical volume of "494.16 MB" --- NEW Physical volume --- PV Name/dev/sdd1 VG Name PV Size 494.16 MB Allocatable no pe Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 pv uuid bgfuhw-eOve-5n87-gKoV-ApCh-GDuv-0WKzJ3 [root @ o564gtser1 ~] # Vgcreate oravg/dev/sdd1 Volume group "oravg" successfully created [root @ o564gtser1 ~] # Vgs VG # PV # LV # SN Attr VSize VFree oravg 1 0 0 wz -- n-492.00 M 492.00 M [root @ o564gtser1 ~] # Vgdisplay --- Volume group --- VG Name oravg System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 1 VG Access read/write VG Status resizable max lv 0 Cur LV 0 Open LV 0 Max PV 0 cur PV 1 Act PV 1 VG Size 492.00 mb pe Size 4.00 MB Total PE 123 Alloc PE/Size 0/0 Free PE/Size 123/492 .00 mb vg uuid 6KYQkB-3W81-fMAa-vBJ0-9UXk-jaRd-XRMOUQ [root @ o564gtser1] # Vgs oravg VG # PV # LV # SN Attr VSize VFree oravg 1 0 0 wz -- n-492.00 M 492.00 M [root @ o564gtser1 ~] # Vgdisplay oravg --- Volume group --- VG Name oravg System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 1 VG Access read/write VG Status resizable max lv 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 492.00 mb pe Size 4.00 MB Total PE 123 Alloc PE/Size 0/0 Free PE/Size 123/492 .00 mb vg uuid restart [root @ o564gtser1 ~] # Pvs pv vg Fmt Attr PSize PFree/dev/sdd1 oravg lvm2 a-492.00 M 492.00 M [root @ o564gtser1 ~] # Lvcreate-L200MB-n oralv1 oravg Logical volume "oralv1" created [root @ o564gtser1 ~] # Lvcreate-L200MB-n oralv2 oravg Logical volume "oralv2" created [root @ o564gtser1 ~] # Vgdisplay-v Finding all volume groups Finding volume group "oravg" --- Volume group --- VG Name oravg System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable max lv 0 Cur LV 2 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 492.00 mb pe Size 4.00 MB Total PE 123 Alloc PE/Size 100/400 .00 MB Free PE/Size 23/92 .00 mb vg uuid 6KYQkB-3W81-fMAa-vBJ0- 9UXk-jaRd-XRMOUQ --- Logical volume --- LV Name/dev/oravg/oralv1 VG Name oravg lv uuid p5LNXk-X32Y-hAV7-sZQZ-7SId-OOPp-7QCpFK LV Write Access read/write LV Status available # open 0 LV Size 200.00 MB Current LE 50 Segments 1 allocation inherit Read ahead sectors auto-currently set to 256 Block device 253: 0 --- Logical volume --- LV Name/dev/oravg/oralv2 VG Name oravg lv uuid 7gFlM5-miH2-ARpg-1 LTc-FQb5-zQX6-Hk0d5u LV Write Access read/write LV Status available # open 0 LV Size 200.00 MB Current LE 50 Segments 1 Allocation inherit Read ahead sectors auto-currently set to 256 Block device 253: 1 --- Physical volumes --- PV Name/dev/sdd1 pv uuid bgfuhw-eOve-5n87-gKoV-ApCh-GDuv-0WKzJ3 PV Status allocatable Total PE/Free PE 123/23 [root @ o564gtser1 ~] # Ls-lL/dev/oravg/oralv * brw-rw ---- 1 root disk 253, 0 04-18 12:27/dev/oravg/oralv1 brw-rw ---- 1 root disk 253, 1 04-18 12:27/dev/oravg/oralv2 [root @ o564gtser1 ~] # Ls/dev/mapper/*-l crw ------- 1 root 10, 62 04-18/dev/mapper/control brw-rw ---- 1 root disk 253, 0 04-18/dev/mapper/oravg-oralv1 brw-rw ---- 1 root disk 253, 1 04-18/dev/mapper/oravg-oralv2 [root @ o564gtser1 ~] # Vi/etc/udev/rules. d/60-raw.rules # Enter raw device bindings here. # An example wocould be: # ACTION = "add", KERNEL = "sda ", RUN + = "/bin/raw/dev/raw/raw1% N" # to bind/dev/raw/raw1 to/dev/sda, or # ACTION = "add", ENV {MAJOR} = "8", ENV {MINOR} = "1 ", RUN + = "/bin/raw/dev/raw/raw2% M % m" # to bind/dev/raw/raw2 to the device with major 8, minor 1. "/etc/udev/rules. d/60-raw.rules "11L, 472C written [r Oot @ o564gtser1 ~] # Cat/etc/udev/rules. d/60-raw.rules # Enter raw device bindings here. # An example wocould be: # ACTION = "add", KERNEL = "sda ", RUN + = "/bin/raw/dev/raw/raw1% N" # to bind/dev/raw/raw1 to/dev/sda, or # ACTION = "add", ENV {MAJOR} = "8", ENV {MINOR} = "1 ", RUN + = "/bin/raw/dev/raw/raw2% M % m" # to bind/dev/raw/raw2 to the device with major 8, minor 1. ACTION = "add", KERNEL = "/dev/oravg/oralv1", RUN + = "/B In/raw/dev/raw/raw3 % N "ACTION =" add ", KERNEL ="/dev/oravg/oralv2 ", RUN + = "/bin/raw/dev/raw/raw4% N" KERNEL = "raw [3-4]", OWNER = "oracle ", GROUP = "oinstall", MODE = "640" [root @ o564gtser1 ~] # Start_udev start udev: [OK] [root @ o564gtser1 ~] # Raw-aq/dev/raw/raw1: bound to major 8, minor 16/dev/raw/raw2: bound to major 8, minor 32 restart the OS, still invalid do not see raw3 and raw4. [root @ o564gtser1 ~] # Cat/etc/udev/rules. d/60-raw.rules # Enter raw device bindings here. # An example wocould be: # ACTION = "add", KERNEL = "sda ", RUN + = "/bin/raw/dev/raw/raw1% N" # to bind/dev/raw/raw1 to/dev/sda, or # ACTION = "add", ENV {MAJOR} = "8", ENV {MINOR} = "1 ", RUN + = "/bin/raw/dev/raw/raw2% M % m" # to bind/dev/raw/raw2 to the device with major 8, minor 1. ACTION = "add", KERNEL = "/dev/oravg/oralv1", RUN + = "/B In/raw/dev/raw/raw3 % N "ACTION =" add ", KERNEL ="/dev/oravg/oralv2 ", RUN + = "/bin/raw/dev/raw/raw4% N" ACTION = "add", ENV {MAJOR} = "253 ", ENV {MINOR} = "0", RUN + = "/bin/raw/dev/raw/raw3% M % m" ACTION = "add ", ENV {MAJOR} = "253", ENV {MINOR} = "1 ", RUN + = "/bin/raw/dev/raw/raw4% M % m" KERNEL = "raw [3-4]", OWNER = "oracle ", GROUP = "oinstall", MODE = "640" restart the OS. If it is still invalid, raw3 and raw4. [root @ o564gtser1 ~] will not be visible. # Cat/etc/udev/rules. d/60-raw.rules # Enter raw device bindings here. # An example wocould be: # ACTION = "add", KERNEL = "sda ", RUN + = "/bin/raw/dev/raw/raw1% N" # to bind/dev/raw/raw1 to/dev/sda, or # ACTION = "add", ENV {MAJOR} = "8", ENV {MINOR} = "1 ", RUN + = "/bin/raw/dev/raw/raw2% M % m" # to bind/dev/raw/raw2 to the device with major 8, minor 1. ACTION = "add", KERNEL = "/dev/mapper/oravg-oralv1", R UN + = "/bin/raw/dev/raw/raw3% N" ACTION = "add", KERNEL = "/dev/mapper/oravg-oralv2 ", RUN + = "/bin/raw/dev/raw/raw4% N" # ACTION = "add", ENV {MAJOR} = "253 ", ENV {MINOR} = "0", RUN + = "/bin/raw/dev/raw/raw3% M % m" # ACTION = "add ", ENV {MAJOR} = "253", ENV {MINOR} = "1 ", RUN + = "/bin/raw/dev/raw/raw4% M % m" KERNEL = "raw [3-4]", OWNER = "oracle ", GROUP = "oinstall", MODE = "640" restart the OS. If the OS is still invalid, you cannot see raw3 or raw4. it is possible to use a manual test: [roo T @ o564gtser1 ~] #/Bin/raw/dev/raw/raw3/dev/mapper/oravg-oralv1/dev/raw/raw3: bound to major 253, minor 0 [root @ o564gtser1 ~] #/Bin/raw/dev/raw/raw4/dev/mapper/oravg-oralv2/dev/raw/raw4: bound to major 253, minor 1 [root @ o564gtser1 ~] # Raw-qa/dev/raw/raw1: bound to major 8, minor 16/dev/raw/raw2: bound to major 8, minor 32/dev/raw/raw3: bound to major 253, minor 0/dev/raw/raw4: bound to major 253, minor 1 [root @ o564gtser1 ~] # Ll/dev/raw/* crw-r ----- 1 oracle oinstall 162, 1 04-18/dev/raw/raw1 crw-r ----- 1 oracle oinstall 162, 2 04-18/dev/raw/raw2 crw-r ----- 1 oracle oinstall 162, 3 04-18/dev/raw/raw3 crw-r ----- 1 oracle oinstall 162, 4 04-18/dev/raw/raw4 had to write the above two lines of commands into/etc/rc. d/rc. local: # add by gtlions test for lvm used in oracle/bin/raw/dev/raw/raw3/dev/maper/oravg-oralv1/bin/raw/dev /Raw/raw4/dev/mapper/oravg-oralv2 chown oracle: oinstall/dev/raw/raw3 chown oracle: oinstall/dev/raw/raw4 chmod 640/dev/raw/raw3 chmod 640/dev/raw/raw4 and delete/etc/udev/rules. d/60-raw.rules. In this way, you can use it in Oracle: [oracle @ o564gtser1 ~] $ Sqlplus "/as sysdba" SQL * Plus: Release 10.2.0.5.0-Production on Thu Apr 18 13:25:48 2013 Copyright (c) 1982,201 0, Oracle. all Rights Reserved. connected to an idle instance. SQL> startup ORACLE instance started. total System Global Area 281018368 bytes Fixed Size 2095672 bytes Variable Size 96470472 bytes Database Buffers 176160768 bytes Redo Buffers 6291456 bytes Database mounted. database op Ened. SQL> select file_name from dba_data_files; FILE_NAME upload + DATA01/gt10g/datafile/upload + DATA01/gt10g/datafile/upload + DATA01/gt10g/datafile/upload + DATA01/gt10g/datafile/users.264.812537785 SQL> create tablespace test datafile '/dev/raw/raw3' size 190 m autoextend off; tabl Espace created. SQL> select file_name from dba_data_files; FILE_NAME alias + DATA01/gt10g/datafile/example + DATA01/gt10g/datafile/example + DATA01/gt10g/datafile/example + DATA01/gt10g/datafile/users.264.812537785/dev/raw/raw3 it seems that it needs to be written directly to/etc/rc. d/rc. local. -EOF-

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.