Oracle 11g ASM Diskgroup Compatibility:
In Oracle 10.2, the are two new column COMPATIBILITY and DATABASE_COMPATIBILITY added to the V$ASM_DISKGROUP view, but only in Oracle 11g introduce the concept of diskgroup attributes and the V$ASM_ATTRIBUTE view.
New Disk Group Compatibility Attributes
Oracle 11g ASM includes two new compatibility attributes (compatible.asm and compatible.rdbms ) that determine the version of the ASM and database software that can use specific disk groups :
- COMPATIBLE.ASM – The minimum version of the ASM software that can access the disk group. In 11g, the default setting is 10.1.
- COMPATIBLE.RDBMS – The minimum COMPATIBLE database initialization parameter setting for any database instance that uses the disk group. In 11g, the default setting is 10.1.
The compatibility versions of a disk group can only be increased, not decreased. If you have increased the version by mistake, you will need to create a new disk group.
The disk group compatibility attributes can be set during disk group creation by adding the ATTRIBUTE clause to the CREATE DISKGROUP command.
compatible.asm is the Oracle disk group compatibility attribute. The Oracle disk group compatible.asm attribute setting defines the format of the data on the ASM disks, and should always be equal to or greater than the Oracle database compatibility parameter.
The compatible.rdbms attribute is the second attribute known as the Oracle database compatibility attribute. The compatible.rdbms attribute defines the minimum version of an Oracle database that can mount a specific disk group. The compatible.rdbms attribute should be set to a value that is equivalent to the lowest compatibility setting of any Oracle database that will be mounting that disk group.
The compatible.asm attribute must always be set to a value that is equal to or greater than the compatible.rdbms attribute. Once the compatible.asm attribute is set, it cannot be rolled back.
Once the compatible.rdbms attribute is set, it cannot be rolled back. This is because ASM will be writing to the disk and communicating with the database in a version specific format. Oracle does allow you to roll the setting forward.
Thus, there are two ways to check the diskgroup attributes in Oracle 11g:
SQL> col COMPATIBILITY for a10 SQL> col DATABASE_COMPATIBILITY for a10 SQL> col NAME form a20 SQL> select group_number, name, compatibility, database_compatibility from v$asm_diskgroup; GROUP_NUMBER NAME COMPATIBIL DATABASE_C ------------ -------------------- ---------- ---------- 1 PAWFG 11.2.0.0.0 11.2.0.0.0 2 DATA 11.2.0.0.0 10.1.0.0.0 SQL> col value for a10 SQL> @dg_attribs1.sql; dg name attrib name VALUE READ_ON -------------------- ------------------------------ -------------------- ------- PAWFG disk_repair_time 5h N PAWFG au_size 1048576 Y PAWFG access_control.umask 066 N PAWFG access_control.enabled FALSE N PAWFG cell.smart_scan_capable FALSE N PAWFG compatible.rdbms 11.2.0.0.0 N PAWFG compatible.asm 11.2.0.0.0 N PAWFG sector_size 512 Y DATA disk_repair_time 3.6h N DATA access_control.enabled FALSE N DATA cell.smart_scan_capable FALSE N DATA compatible.rdbms 10.1.0.0.0 N DATA compatible.asm 11.2.0.0.0 N DATA sector_size 512 Y DATA au_size 1048576 Y DATA access_control.umask 066 N 16 rows selected.
Note that V$ASM_ATTRIBUTES is filled only when compatible.asm is set to 11.1. What’s important is that you can only change compatibility level upwards; there is no way to reset it back to the lower value.
Compatibility attributes can be changed online one at a time:
SQL> alter diskgroup DATA set attribute 'compatible.asm'='11.2.0.0.0'; Diskgroup altered. SQL> SQL> alter diskgroup DATA set attribute 'compatible.rdbms'='11.2.0.0.0'; Diskgroup altered. SQL> select group_number, name, compatibility, database_compatibility from v$asm_diskgroup; GROUP_NUMBER NAME COMPATIBIL DATABASE_C ------------ -------------------- ---------- ---------- 1 PAWFG 11.2.0.0.0 11.2.0.0.0 2 DATA 11.2.0.0.0 11.2.0.0.0
What are compatibility attributes are useful for? They are very handy for upgrades and migrations when ASM diskgroups need to be available for ASM instances and database instances of different versions. Depending on the migration path, you might need to be able to access some diskgroups from different versions of ASM and different database instances.
It might also be useful for transportable tablespaces between 10g and 11g databases.
The compatible.asm diskgroup attribute controls the format of the ASM diskgroup metadata. Only ASM instances with a software version equal to or greater than compatible.asm can mount the diskgroup.
As we know The compatible.rdbms diskgroup attribute determines the format of ASM files themselves. The diskgroup can be accessed by any database instance with a compatible init.ora parameter set equal to or higher than the compatible.rdbms attribute.
Note that the compatible.rdbms attribute can be set to 10.2 as well, but we couldn’t see if there were any differences in the feature set except that the compatible.rdbms=10.2, setting requires a database instance with the compatible parameter set to 10.2 or higher. compatible.asm cannot be set below 11.1 except when it’s already 10.1 by default.
The compatible.rdbms attribute can be changed only if compatible.asm is advanced to 11.1. Otherwise, you get the following error message:
SQL> alter diskgroup DATA set attribute 'compatible.rdbms'='11.1'; alter diskgroup DATA set attribute 'compatible.rdbms'='11.1' * ERROR at line 1: ORA-15032: not all alterations performed ORA-15242: could not set attribute compatible.rdbms ORA-15221: ASM operation requires compatible.asm of 11.1.0.0.0 or higher
When creating a new diskgroup, compatibility attributes can be explicitly specified. It is interesting that the default is still 10.1 for both attributes even when the diskgroup is created from an ASM 10g instance and all connected databases are of 11g version. Oracle is conservative here.
IF we want to set default compatibility , there are two underscore hidden parameter exits which shows, what exactly the default compatibilty: _asm_compatibility and _rdbms_compatibility:
SQL> select i.ksppinm, v.ksppstvl from x$ksppi i, x$ksppcv v where i.ksppinm in ('_rdbms_compatibility','_asm_compatibility') and i.indx=v.indx; KSPPINM KSPPSTVL ------------------------------ ---------- _asm_compatibility 10.1 _rdbms_compatibility 10.1
Let’s test.
SQL> alter system set "_asm_compatibility"='11.1' scope=spfile; System altered. SQL> alter system set "_rdbms_compatibility"='11.1' scope=spfile; System altered. SQL> shutdown immediate ASM diskgroups dismounted ASM instance shutdown SQL> startup ASM instance started Total System Global Area 284565504 bytes Fixed Size 1299428 bytes Variable Size 258100252 bytes ASM Cache 25165824 bytes ASM diskgroups mounted SQL> select i.ksppinm, v.ksppstvl from x$ksppi i, x$ksppcv v where i.ksppinm in ('_rdbms_compatibility','_asm_compatibility') and i.indx=v.indx; KSPPINM KSPPSTVL ------------------------------ ---------- _asm_compatibility 11.1 _rdbms_compatibility 11.1 SQL> create diskgroup DATA1 external redundancy disk ' /dev/oracleasm/disks/DISK10' ATTRIBUTE 'compatible.asm' = '11.1'; Diskgroup created. SQL> select name, compatibility, database_compatibility from v$asm_diskgroup where name='DATA1'; NAME COMPATIBIL DATABASE_C -------------------- ---------- ---------- DATA1 11.1.0.0.0 11.1.0.0.0
SQL> CREATE DISKGROUP DATA2 DISK '/dev/oracleasm/disks/DISK11' ATTRIBUTE 'compatible.rdbms' = '11.2', 'compatible.asm' = '11.1'; Diskgroup created. SQL> select group_number, allocation_unit_size, compatibility, database_compatibility from v$asm_diskgroup where name='DATA2'; GROUP_NUMBER ALLOCATION_UNIT_SIZE COMPATIBIL DATABASE_C ------------ -------------------- ---------- ---------- 4 2097152 11.2.0.0.0 11.1.0.0.0
Now what features are available with different compatibility settings?
Diskgroup attributes:
compatible.asm — 11.1
compatible.rdbms — any
Non-default allocation unit size :
For AU sizes 1-8 MB, both compatibility attributes can be 10.1.
SQL> select group_number, allocation_unit_size, compatibility, database_compatibility from v$asm_diskgroup where name='DATA3'; GROUP_NUMBER ALLOCATION_UNIT_SIZE COMPATIBIL DATABASE_C ------------ -------------------- ---------- ---------- 5 2097152 10.0.0.0.0 10.1.0.0.0 SQL> select group_number, name, value from v$asm_attribute where group_number=4; no rows selected The absence of the attribute au_size in V$ASM_ATTRIBUTE is confusing, but recall that attributes are displayed only when compatible.asm is set to 11.1. SQL> select group_number, name, value from v$asm_attribute where group_number=4; GROUP_NUMBER NAME VALUE ------------ -------------------- -------------------- 3 disk_repair_time 3.6h 3 au_size 2097152 3 compatible.asm 11.1.0.0.0 3 compatible.rdbms 10.1.0.0.0
For AU sizes 16-64 MB both compatibility attributes must be 11.1.
@dg_attribs1.sql --Show disk group attributes col "dg name" for a20 col "attrib name" for a30 col value for a20 set pagesize 20 select dg.name "dg name" ,a.name "attrib name" ,a.value ,read_only from v$asm_diskgroup dg, v$asm_attribute a where dg.group_number = a.group_number and a.name not like 'template%';
Thank you for reading… This is Airy…Enjoy Learning