4 Replies Latest reply: Jun 11, 2014 2:30 AM by Aritra-Oracle RSS

    How to extract the DDL of diskgroups ?

    Anurag Vidyarthi-Oracle

      I am testing the RAC disaster recovery(Linux+11gR2) and for this purpose , I need to copy the ASM structure from one production cluster to test cluster.On the test cluster there are already few diskgroups but rest needs to be copied from production .Is there any way ; I can generate the DDL for existing diskgroups ?

       

      Thanks in advance !

        • 1. Re: How to extract the DDL of diskgroups ?
          FreddieEssex

          You can use md_backup/md_restore to backup the ASM metadata and restore it.

          • 2. Re: How to extract the DDL of diskgroups ?
            Billy~Verreynne

            Why would you want to duplicate the ASM diskgroup at a physical level on the test cluster?

             

            What guarantees do you have that device names for example on the test cluster is identical to that of the production cluster? Especially when WWIDs are unique and will differ between clusters.

             

            Unless you have sysadmins who know what they are doing, and are actively keeping the storage layers identical down to device names between live and test clusters, be careful of simply (and blindly) duplicating physical attributes of live on test.

            • 3. Re: How to extract the DDL of diskgroups ?
              Anurag Vidyarthi-Oracle

              you are correct Billy. In this scenario we have identical disk groups (with lesser capacities on test cluster) but we have to take your statement into account too. Thanks.

              • 4. Re: How to extract the DDL of diskgroups ?
                Aritra-Oracle

                Hi,

                 

                You can take md_backup of existing diskgroup and modify disk name as per new environment.

                Then use md_restore command to create diskgroup of same structure

                 

                 

                 

                Example ,like below,

                 

                 

                ASMCMD> md_backup /tmp/data_md.bak -G DATA

                Disk group metadata to be backed up: DATA

                Current alias directory path: caram/datafile

                Current alias directory path: RED_UNIQ/TEMPFILE

                Current alias directory path: ORCL/TEMPFILE

                 

                 

                From output file,

                 

                 

                'DISKSINFO' => {

                                                      'DATA1' => {

                                                                   'DATA1' => {

                                                                                'TOTAL_MB' => '2047',

                                                                                'FAILGROUP' => 'DATA1',

                                                                                'NAME' => 'DATA1',

                                                                                'DGNAME' => 'DATA',

                                                                                'PATH' => 'ORCL:DATA1'

                                                                              }

                                                                 },

                                                      'DATA2' => {

                                                                   'DATA2' => {

                                                                                'TOTAL_MB' => '2047',

                                                                                'FAILGROUP' => 'DATA2',

                                                                                'NAME' => 'DATA2',

                                                                                'DGNAME' => 'DATA',

                                                                                'PATH' => 'ORCL:DATA2'

                 

                 

                Change the disk information accrodingly your new system disk name .

                 

                 

                 

                Regards,

                Aritra