asm using asmlib and raw devices-1.doc

Upload: mohd-yasin

Post on 02-Jun-2018

235 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    1/17

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    2/17

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    3/17

    $nstall the packages as the root user.

    # rp% 57vh oracleas%5support52+151i?

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    4/17

    #he disks are now ready to be used by ASM.

    Raw Device Setup

    #his step is only necessary if you want ASM to access the disks as raw devices.

    ,dit the 45etc5sysconfig5rawdevices4 file adding the following lines.

    /dev/ra"/ra"1 /dev/sdb1/dev/ra"/ra"2 /dev/sdc1/dev/ra"/ra" /dev/sdd1

    Restart the rawdevices service using the following command.

    service ra"devices restart

    Run the following commands and add them the 45etc5rc.local4 file.

    cho"n oracle.oinstall /dev/ra"/ra"1cho"n oracle.oinstall /dev/ra"/ra"2cho"n oracle.oinstall /dev/ra"/ra"ch%od

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    5/17

    Select the 47onfigure Automatic Storage Management4 option then click the 4%e"t4 /utton.

    $f the Oracle 7luster Syncroni:ation Service (7SS) is not currently running a warning screen

    will be displayed. 6ollow the instructions and click the 4O;4 button. Once you

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    6/17

    #he script gives the following output.

    # /u+1/app/oracle/product/1+2+/dbM1/bin/localconfi! add/etc/oracle does not e4ist $reatin! it no"Successfull& accu%ulated necessar& O$ ke&s

    $reatin! O$ ke&s for user (root(, priv!rp (root(Operation successful$onfi!uration for local $SS has been initiali9ed

    'ddin! to inittabStartup "ill be Eueued to init "ithin =+ seconds$heckin! the status of ne" Oracle init process>4pectin! the $S dae%ons to be up "ithin

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    7/17

    On the confirmation screen click the 4O;4 button.

    'ait while the ASM instance is created.

    Once the ASM instance is created you are presented with the 4ASM 0isk 2roups4 screen.

    7lick the 47reate %ew4 button.

    On the 47reate 0isk 2roup4 screen enter 0isk 2roup %ame of 40A#A4 and select the

    re1uired level of redundancy&

    (+ternal . ASM does not mirror the *les0 5his option should onl6 be used if6our disks are alread6 protected b6 some form of redundanc67 like RAID0

    &ormal . ASM performs two.wa6 mirroring of all *les0

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    8/17

    8igh . ASM performs three.wa6 mirroring of all *les0

    $n this e"ample the 4+igh4 redundancy is used. Select all three candidate disks and click the

    4O;4 button. #he following image shows how the candidate disks are displayed when using

    ASM!ib.

    'hen using raw devices the candidate discs are listed using the devide names.

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    9/17

    On the 4ASM 0isk 2roups4 screen. 7lick the 46inish4 button.

    7lick the 4=es4 button to perform another operation.

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    10/17

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    11/17

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    12/17

    ,nter the ASM password if prompted then click the 4O;4 button.

    Select the 40A#A4 disk group then clicking the 4%e"t4 button.

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    13/17

    Accept the default 4Oracle>Managed 6iles4 database location by clicking the 4%e"t4 button.

    ,nable the 46lash Recovery Area4 and Archiving using the 4?0A#A4 disk group for both.

    7ontinue with the rest of the 0/7A selecting the re1uired options along the way.

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    14/17

    Switching from Raw Devices to ASMLib

    Shutdown any databases using the ASM instance but leave the ASM instance itself running.

    7onnect to the running ASM instance.

    N e4port O'$>MSID8'S:N sElplus / as s&sdba

    @erform the ASM!ib $nstallation but stop prior to stamping the ASM disk. $f you attempt to

    stamp the disks using the creatediskcommand it will fail.

    Alter the ASM disk discovery string to e"clude the raw devices used previously then

    shutdown the ASM instance.

    SPJ ')> SS)>: S>) as%Mdiskstrin! (O$.LO*( S$O6>S6FI>Q

    S&ste% altered

    SPJ S7)DO3H I::>DI')>Q'S: disk!roups dis%ounted'S: instance shutdo"nSPJ

    $f you are planning to remove the raw device mappings (Raw 0evice Setup) you could

    simply reset the 'S:MDISGO76parameter.

    SPJ ')> SS)>: >S>) as%Mdiskstrin! S$O6>S6FI> SID(*(Q

    S&ste% altered

    SPJ

    At this point the disks will not be used by ASM because they are not stamped. As mentioned

    previously the creatediskcommand used to stamp new disks would fail so we must issue

    the rena%ediskcommand as the root user for each disk.

    # /etc/initd/oracleas% rena%edisk /dev/sdb1 LO1ena%in! disk K/dev/sdb1K to KLO1K. A O C# /etc/initd/oracleas% rena%edisk /dev/sdc1 LO2ena%in! disk K/dev/sdc1K to KLO2K. A O C

    # /etc/initd/oracleas% rena%edisk /dev/sdd1 LOena%in! disk K/dev/sdd1K to KLOK. A O C#

    %otice the stamp matches the discovery string set earlier. #he ASM instance can now be

    started.

    SPJ S)')76'S: instance started

    )otal S&ste% Global 'rea ???

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    15/17

    SPJ

    #he ASM instance is now using ASM!ib rather than raw devices. All dependent databases

    can now be started.

    Switching from ASMLib to Raw Devices

    Shutdown any databases using the ASM instance but leave the ASM instance itself running.

    7onnect to the running ASM instance.

    N e4port O'$>MSID8'S:N sElplus / as s&sdba

    Alter the ASM disk discovery string to match the raw devices you plan to set up then

    shutdown the ASM instance.

    SPJ ')> SS)>: S>) as%Mdiskstrin! (/dev/ra"/ra"*( S$O6>S6FI>Q

    S&ste% altered

    SPJ S7)DO3H I::>DI')>Q'S: disk!roups dis%ounted'S: instance shutdo"nSPJ

    @erform all the steps listed in the Raw 0evice Setupthen start the ASM instance.

    SPJ S)')76

    'S: instance started

    )otal S&ste% Global 'rea ???

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    16/17

    $>')> )'>S6'$> testMtsQ

    $>')> 7S> testMuser ID>H)IFI>D testMuser D>F'7) )'>S6'$> testMtsP7O)' 7HI:I)>D OH testMtsQG'H) $OHH>$), $>')> )'> )O testMuserQ

    $OHH testMuser/testMuser

    $>')> )'> testMtab 0 id H7:>, data L'$'20-+++, $OHS)'IH) testMtabMpk 6I:' > 0idQ

    #hen as the test user $ ran the following code several times and calculated an average time

    for each operation.

    S>) S>L>O7)67) OH

    D>$'> lMloops H7:> . 1+++Q lMdata L'$'202S 0i, lMdataQ $O::I)Q >HD OO6Q

    D:SMO7)67)putMline0(Inserts 0( TT lMloops TT (. ( TT0D:SM7)II)!etMti%e 5 lMstart TT ( hsecs(Q

    lMstart . D:SM7)II)!etMti%eQ

    FO i IH 1 lMloops OO6 76D')> testMtab S>) data lMdata 3>> id iQ $O::I)Q >HD OO6Q

    D:SMO7)67)putMline0(7pdates 0( TT lMloops TT (. ( TT0D:SM7)II)!etMti%e 5 lMstart TT ( hsecs(Q

    lMstart . D:SM7)II)!etMti%eQ

    FO i IH 1 lMloops OO6 D>>)> FO: testMtab 3>> id iQ $O::I)Q >HD OO6Q

    D:SMO7)67)putMline0(Deletes 0( TT lMloops TT (. ( TT0D:SM7)II)!etMti%e 5 lMstart TT ( hsecs(Q

    >R>$7)> I::>DI')> ()7H$')> )'> testMtab(Q>HDQ

    /

  • 8/10/2019 ASM using ASMLib and Raw Devices-1.doc

    17/17

    #he code is purposely inefficient using a single statement and a commit within a loop for

    each operation. Remember the ASM instance is using high redundancy so each physical

    write operation is effectively done 8 times.

    Once the tests on ASM!ib were complete $ switched to using raw devices and repeated the

    tests. #he average results for of each operation are listed below.

    Operation 'S:ib 0hsecs a" Devices 0hsecs Inserts 01+++ -