This discussion is archived
10 Replies Latest reply: Apr 11, 2013 9:39 AM by Levi-Pereira RSS

ASM Diskgroup existing disks

864988 Newbie
Currently Being Moderated
Hello,
Oracle RDBMS version 11.2.0.3.0
OS: OEL 6.3
Grid Infrastructure Standalone server.
MY question: I want to connect existing disks to ASM instance. which commands allow me to create the new diskgroup usingthe existing disks without erase the data in disks?
  • 1. Re: ASM Diskgroup existing disks
    FreddieEssex Pro
    Currently Being Moderated
    As far as I'm aware, you can't create a new diskgroup with those disks without erasing the data.

    You should however be able to mount the diskgroup using the existing ASM instance.

    Include the diskgroup in the asm_diskgroup parameter (if required) and include the disks in asm_diskstring parameter and give it a shot.

    Before you mount the diskgroup it should be visible to ASM in v$asm_disk:
    select group_number, mode_status, name, header_status, path from v$asm_disk order by 1;
  • 2. Re: ASM Diskgroup existing disks
    Levi-Pereira Guru
    Currently Being Moderated
    DBA wrote:
    Hello,
    Oracle RDBMS version 11.2.0.3.0
    OS: OEL 6.3
    Grid Infrastructure Standalone server.
    MY question: I want to connect existing disks to ASM instance. which commands allow me to create the new diskgroup usingthe existing disks without erase the data in disks?
    NONE. You cannot do that. You can't use a ASMDISKS with status MEMBER. If ASMDISK belong a DISKGROUP it's must be mounted or dropped (cleared) to be reused by other DISKGROUP .
  • 3. Re: ASM Diskgroup existing disks
    905935 Newbie
    Currently Being Moderated
    No, you cannot connect the existing disks to ASM instance with out erasing the data.

    Just FYI the process for adding the disk is as follows:


         
    Create a dummy diskgroup using your new disk as below.

    1) create diskgroup test external REDUNDANCY Disk 'NEWVOL1' ;
    2) Alter diskgroup test add disk 'NEWVOL2';

    SELECT STATE, NAME FROM V$ASM_DISKGROUP;
    alter diskgroup test mount;
    SELECT STATE, NAME FROM V$ASM_DISKGROUP;

    SQL> alter diskgroup test dismount; --(from the ASM INSTANCE).

    SQL> DROP DISKGROUP TEST; --(from the ASM instance, which the diskgroup is still mounted).

    ------------------------------------------------------------------------------------------

    Adding in original disk group

    SQL> ALTER DISKGROUP ORCL_DATA1 ADD DISK 'ORCL:NEWVOL1';

    Let rebalance be completed.

    Check
    select * from v$asm_operation;

    it should not return any row.


    Once we add the disk to the existing group all the data will be balanced between the disks so that implies that disk should be clean enough when providing it to existing disk group.
  • 4. Re: ASM Diskgroup existing disks
    MahirM.Quluzade Guru
    Currently Being Moderated
    DBA wrote:
    Hello,
    Oracle RDBMS version 11.2.0.3.0
    OS: OEL 6.3
    Grid Infrastructure Standalone server.
    MY question: I want to connect existing disks to ASM instance. which commands allow me to create the new diskgroup usingthe existing disks without erase the data in disks?
    Hi,

    You can not use same disk in two or more diskgroup.
    If you want use existing disk in other diskgroup then, this disks will be erase.

    You can use ASMCA tool for easy manage ASM Diskgroups.

    Regards
    Mahir M. Quluzade
  • 5. Re: ASM Diskgroup existing disks
    864988 Newbie
    Currently Being Moderated
    Hello,
    Please let me explain my issue;
    I am going to move databases from host1 to host2, with same OS version, same oracle db version etc .. but with more RAM, CPU ...
    I am going to keep ASM disks and present the same LUNs to host2.
    I need to install first grid infrastructure ASM / Oracle database software 11.2.0.3 first.
    How can I install ASM grid infrastructure without specifying ASM Diskgroups during installation steps?
    I will need then to just specify asm_diskstring / asm_diskgroup and let ASM discover the existing disks.
    I believe I need to specify an ASM diskgroup for ASM spfile. How to resolve this issue?!

    Edited by: DBA on Apr 11, 2013 2:40 AM
  • 6. Re: ASM Diskgroup existing disks
    864988 Newbie
    Currently Being Moderated
    Hello,
    Please let me explain my issue;
    I am going to move databases from host1 to host2, with same OS version, same oracle db version etc .. but with more RAM, CPU ...
    I am going to keep ASM disks and present the same LUNs to host2.
    I need to install first grid infrastructure ASM / Oracle database software 11.2.0.3 first.
    How can I install ASM grid infrastructure without specifying ASM Diskgroups during installation steps?
    I will need then to just specify asm_diskstring / asm_diskgroup and let ASM discover the existing disks. right?
    I believe I need to specify an ASM diskgroup for ASM spfile. How to resolve this issue?!

    Edited by: DBA on Apr 11, 2013 2:40 AM
  • 7. Re: ASM Diskgroup existing disks
    864988 Newbie
    Currently Being Moderated
    I think I will have to;
    For 11.2.0.3 version on Oracle Enterprise Linux 6.3;

    1- Install Grid Infrastructure Standalone with "Grid Infrastructure Software Only" option
    2- Install Oracle Database Software Only.

    Now Steps for ASM Manual Creation;

    1- Create the password file for ASM instance manual creation;
    orapwd file=$ORACLE_HOME/dbs/orapw+ASM password=Password123 entries=5

    2- Create required directories:

    mkdir -p $ORACLE_BASE/admin/+ASM
    cd $ORACLE_BASE/admin/+ASM
    mkdir bdump
    mkdir udump
    mkdir cdump
    mkdir pfile

    3- Create the init+ASM.ora file under the $ORACLE_HOME/dbs :

    asm_diskgroups='DATA','FRA'
    asm_diskstring='/dev/oracleasm/disks/*'
    background_dump_dest='/u01/app/admin/+ASM/bdump'
    core_dump_dest='/u01/app/admin/+ASM/cdump'
    instance_type='asm'
    large_pool_size=12M
    user_dump_dest='/u01/app/admin/+ASM/udump'

    4- export ORACLE_SID=+ASM
    5- Startup ASM instance in mount mode:

    sqlplus / as sysasm
    create spfile from pfile;
    startup mount
    show parameter disk

    6- Mount Diskgroups;

    alter diskgroup fra mount;
    alter diskgroup data mount;

    Thank you for any input ?

    Regards
  • 8. Re: ASM Diskgroup existing disks
    MahirM.Quluzade Guru
    Currently Being Moderated
    DBA wrote:
    I think I will have to;
    For 11.2.0.3 version on Oracle Enterprise Linux 6.3;

    1- Install Grid Infrastructure Standalone with "Grid Infrastructure Software Only" option
    2- Install Oracle Database Software Only.

    Now Steps for ASM Manual Creation;

    1- Create the password file for ASM instance manual creation;
    orapwd file=$ORACLE_HOME/dbs/orapw+ASM password=Password123 entries=5

    2- Create required directories:

    mkdir -p $ORACLE_BASE/admin/+ASM
    cd $ORACLE_BASE/admin/+ASM
    mkdir bdump
    mkdir udump
    mkdir cdump
    mkdir pfile

    3- Create the init+ASM.ora file under the $ORACLE_HOME/dbs :

    asm_diskgroups='DATA','FRA'
    asm_diskstring='/dev/oracleasm/disks/*'
    background_dump_dest='/u01/app/admin/+ASM/bdump'
    core_dump_dest='/u01/app/admin/+ASM/cdump'
    instance_type='asm'
    large_pool_size=12M
    user_dump_dest='/u01/app/admin/+ASM/udump'

    4- export ORACLE_SID=+ASM
    5- Startup ASM instance in mount mode:

    sqlplus / as sysasm
    create spfile from pfile;
    startup mount
    show parameter disk

    6- Mount Diskgroups;

    alter diskgroup fra mount;
    alter diskgroup data mount;

    Thank you for any input ?

    Regards
    It is looks very good.
    You can create ASM instance with ASMCA, too.
    After that you can scan asm disk groups.
    Then you can create a database service same name and start database with parameter file with content SPFILE=+DATA\PARAMETERTERFILE\SPFILE.ORA

    Edited by: Mahir M. Quluzade on Apr 11, 2013 5:37 PM
  • 9. Re: ASM Diskgroup existing disks
    FreddieEssex Pro
    Currently Being Moderated
    Looks good.

    I don't bother with the different directories and have *.diagnostic_dest='/u01/app/oracle' or whatever you may want to set this to and get rid of cdump, bdump etc.

    Once you mount your ASM instance you should be able to run the following query and see the disks:
    select group_number, mode_status, name, header_status, path from v$asm_disk;
    You should then be able to mount the diskgroups as normal.
  • 10. Re: ASM Diskgroup existing disks
    Levi-Pereira Guru
    Currently Being Moderated
    Hi,
    My recomendation is create ASM instance using ASCMA.

    Because the step mentioned below is valid only to 11.1 or lower, for 11.2 is missing some additional steps.


    Now Steps for ASM Manual Creation;

    1- Create the password file for ASM instance manual creation;
    orapwd file=$ORACLE_HOME/dbs/orapw+ASM password=Password123 entries=5
    This way the user ASMSNMP will not be created and you will need manually grant SYSASM role to SYS user. ASMCA do it automatically.

    2- Create required directories:

    mkdir -p $ORACLE_BASE/admin/+ASM
    cd $ORACLE_BASE/admin/+ASM
    mkdir bdump
    mkdir udump
    mkdir cdump
    mkdir pfile
    These directories are obsolete on 11.2, now Oracle use ADR to store logs.

    3- Create the init+ASM.ora file under the $ORACLE_HOME/dbs :

    asm_diskgroups='DATA','FRA'
    asm_diskstring='/dev/oracleasm/disks/*'
    background_dump_dest='/u01/app/admin/+ASM/bdump'
    core_dump_dest='/u01/app/admin/+ASM/cdump'
    instance_type='asm'
    large_pool_size=12M
    user_dump_dest='/u01/app/admin/+ASM/udump'
    ASMCA set memory target at least 272M

    4- export ORACLE_SID=+ASM
    5- Startup ASM instance in mount mode:

    sqlplus / as sysasm
    create spfile from pfile;
    startup mount
    show parameter disk

    6- Mount Diskgroups;

    alter diskgroup fra mount;
    alter diskgroup data mount;
    Some steps is missing here.

    ASMCA will enable/configure "ora.asm" (by adding SPFILE and some PARAMETERS on OLR) resources and all resources dependent and will create DISKGROUP resources.
    If you don't config it, ASM will not be started/stoped/restarted automatically.

    So again.. Is recommended create a ASM Instance using ASMCA and using a SMALL Lun (1GB) to store only SPFILE of ASM during creation and after just mount the others DISKGROUP.

    When you will enable your database or add on Oracle Restart, the resources DISKGROUP and ASM must exists to work properly
    Edited by: Levi Pereira on Apr 11, 2013 1:31 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points