Oracle ASM Flex Disk Group Support for Multitenant Cloning Feature
A flex disk group enables the creation of point-in-time database clones. When an ASM database clone is made, all the files associated with the database are split together and provide an independent database.
Oracle Database 18c Release 1 provides ASM clones for multitenant databases i.e. PDBs. In later updates, this feature can also be used for non-multitenant databases.
Example of making an ASM clone of a PDB:
[oracle@rac1-18c ~]$ . oraenv
ORACLE_SID = [orcl1] ? +ASM1
The Oracle base has been changed from /u01/app/oracle to /u01/app/grid
[oracle@rac1-18c ~]$
ORACLE_SID = [orcl1] ? +ASM1
The Oracle base has been changed from /u01/app/oracle to /u01/app/grid
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ asmcmd
ASMCMD> lsdg
State Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 512 4096 4194304 40952 34892 0 34892 0 N DATADG/
MOUNTED EXTERN N 512 512 4096 4194304 30712 2668 0 2668 0 Y OCRVD/
MOUNTED EXTERN N 512 512 4096 4194304 30712 21264 0 21264 0 N RECODG/
ASMCMD>
ASMCMD> lsdg
State Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 512 4096 4194304 40952 34892 0 34892 0 N DATADG/
MOUNTED EXTERN N 512 512 4096 4194304 30712 2668 0 2668 0 Y OCRVD/
MOUNTED EXTERN N 512 512 4096 4194304 30712 21264 0 21264 0 N RECODG/
ASMCMD>
ASMCMD> lsattr -G DATADG -l
Name Value
access_control.enabled FALSE
access_control.umask 066
appliance._partnering_type GENERIC
ate_conversion_done true
au_size 4194304
cell.smart_scan_capable FALSE
cell.sparse_dg allnonsparse
compatible.advm 18.0.0.0.0
compatible.asm 18.0.0.0.0
compatible.rdbms 10.1.0.0.0
content.check FALSE
content.type data
content_hardcheck.enabled FALSE
disk_repair_time 12.0h
failgroup_repair_time 24.0h
idp.boundary auto
idp.type dynamic
logical_sector_size 512
phys_meta_replicated true
preferred_read.enabled FALSE
scrub_async_limit 1
scrub_metadata.enabled TRUE
sector_size 512
thin_provisioned FALSE
vam_migration_done false
ASMCMD>
Name Value
access_control.enabled FALSE
access_control.umask 066
appliance._partnering_type GENERIC
ate_conversion_done true
au_size 4194304
cell.smart_scan_capable FALSE
cell.sparse_dg allnonsparse
compatible.advm 18.0.0.0.0
compatible.asm 18.0.0.0.0
compatible.rdbms 10.1.0.0.0
content.check FALSE
content.type data
content_hardcheck.enabled FALSE
disk_repair_time 12.0h
failgroup_repair_time 24.0h
idp.boundary auto
idp.type dynamic
logical_sector_size 512
phys_meta_replicated true
preferred_read.enabled FALSE
scrub_async_limit 1
scrub_metadata.enabled TRUE
sector_size 512
thin_provisioned FALSE
vam_migration_done false
ASMCMD>
ASMCMD> lsattr -G RECODG -l
Name Value
access_control.enabled FALSE
access_control.umask 066
appliance._partnering_type GENERIC
ate_conversion_done true
au_size 4194304
cell.smart_scan_capable FALSE
cell.sparse_dg allnonsparse
compatible.advm 18.0.0.0.0
compatible.asm 18.0.0.0.0
compatible.rdbms 10.1.0.0.0
content.check FALSE
content.type data
content_hardcheck.enabled FALSE
disk_repair_time 12.0h
failgroup_repair_time 24.0h
idp.boundary auto
idp.type dynamic
logical_sector_size 512
phys_meta_replicated true
preferred_read.enabled FALSE
scrub_async_limit 1
scrub_metadata.enabled TRUE
sector_size 512
thin_provisioned FALSE
vam_migration_done false
ASMCMD>
Name Value
access_control.enabled FALSE
access_control.umask 066
appliance._partnering_type GENERIC
ate_conversion_done true
au_size 4194304
cell.smart_scan_capable FALSE
cell.sparse_dg allnonsparse
compatible.advm 18.0.0.0.0
compatible.asm 18.0.0.0.0
compatible.rdbms 10.1.0.0.0
content.check FALSE
content.type data
content_hardcheck.enabled FALSE
disk_repair_time 12.0h
failgroup_repair_time 24.0h
idp.boundary auto
idp.type dynamic
logical_sector_size 512
phys_meta_replicated true
preferred_read.enabled FALSE
scrub_async_limit 1
scrub_metadata.enabled TRUE
sector_size 512
thin_provisioned FALSE
vam_migration_done false
ASMCMD>
ASMCMD> exit
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ sqlplus / as sysasm
SQL*Plus: Release 18.0.0.0.0 - Production on Sun Oct 11 14:04:02 2020
Version 18.5.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0
SQL*Plus: Release 18.0.0.0.0 - Production on Sun Oct 11 14:04:02 2020
Version 18.5.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0
SQL> alter diskgroup DATADG set attribute 'compatible.rdbms'='18.0';
Diskgroup altered.
Diskgroup altered.
SQL> alter diskgroup RECODG set attribute 'compatible.rdbms'='18.0';
Diskgroup altered.
SQL> exit
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0
[oracle@rac1-18c ~]$
Diskgroup altered.
SQL> exit
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ asmcmd lsattr -G DATADG -l
Name Value
access_control.enabled FALSE
access_control.umask 066
appliance._partnering_type GENERIC
ate_conversion_done true
au_size 4194304
cell.smart_scan_capable FALSE
cell.sparse_dg allnonsparse
compatible.advm 18.0.0.0.0
compatible.asm 18.0.0.0.0
compatible.rdbms 18.0
content.check FALSE
content.type data
content_hardcheck.enabled FALSE
disk_repair_time 12.0h
failgroup_repair_time 24.0h
idp.boundary auto
idp.type dynamic
logical_sector_size 512
phys_meta_replicated true
preferred_read.enabled FALSE
scrub_async_limit 1
scrub_metadata.enabled TRUE
sector_size 512
thin_provisioned FALSE
vam_migration_done false
[oracle@rac1-18c ~]$
Name Value
access_control.enabled FALSE
access_control.umask 066
appliance._partnering_type GENERIC
ate_conversion_done true
au_size 4194304
cell.smart_scan_capable FALSE
cell.sparse_dg allnonsparse
compatible.advm 18.0.0.0.0
compatible.asm 18.0.0.0.0
compatible.rdbms 18.0
content.check FALSE
content.type data
content_hardcheck.enabled FALSE
disk_repair_time 12.0h
failgroup_repair_time 24.0h
idp.boundary auto
idp.type dynamic
logical_sector_size 512
phys_meta_replicated true
preferred_read.enabled FALSE
scrub_async_limit 1
scrub_metadata.enabled TRUE
sector_size 512
thin_provisioned FALSE
vam_migration_done false
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ asmcmd lsattr -G RECODG -l
Name Value
access_control.enabled FALSE
access_control.umask 066
appliance._partnering_type GENERIC
ate_conversion_done true
au_size 4194304
cell.smart_scan_capable FALSE
cell.sparse_dg allnonsparse
compatible.advm 18.0.0.0.0
compatible.asm 18.0.0.0.0
compatible.rdbms 18.0
content.check FALSE
content.type data
content_hardcheck.enabled FALSE
disk_repair_time 12.0h
failgroup_repair_time 24.0h
idp.boundary auto
idp.type dynamic
logical_sector_size 512
phys_meta_replicated true
preferred_read.enabled FALSE
scrub_async_limit 1
scrub_metadata.enabled TRUE
sector_size 512
thin_provisioned FALSE
vam_migration_done false
[oracle@rac1-18c ~]$
Name Value
access_control.enabled FALSE
access_control.umask 066
appliance._partnering_type GENERIC
ate_conversion_done true
au_size 4194304
cell.smart_scan_capable FALSE
cell.sparse_dg allnonsparse
compatible.advm 18.0.0.0.0
compatible.asm 18.0.0.0.0
compatible.rdbms 18.0
content.check FALSE
content.type data
content_hardcheck.enabled FALSE
disk_repair_time 12.0h
failgroup_repair_time 24.0h
idp.boundary auto
idp.type dynamic
logical_sector_size 512
phys_meta_replicated true
preferred_read.enabled FALSE
scrub_async_limit 1
scrub_metadata.enabled TRUE
sector_size 512
thin_provisioned FALSE
vam_migration_done false
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ sqlplus / as sysasm
SQL*Plus: Release 18.0.0.0.0 - Production on Sun Oct 11 14:09:43 2020
Version 18.5.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0
SQL*Plus: Release 18.0.0.0.0 - Production on Sun Oct 11 14:09:43 2020
Version 18.5.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0
SQL> set lines 100 pages 100
SQL> select name,type from v$asm_diskgroup where name='DATADG';
NAME TYPE
------------------------------ ------
DATADG EXTERN
SQL> select name,type from v$asm_diskgroup where name='DATADG';
NAME TYPE
------------------------------ ------
DATADG EXTERN
If diskgroup type, where datafiles are located is normal, then convert it into flex:
SQL> alter diskgroup DATADG convert redundancy to flex;
alter diskgroup DATADG convert redundancy to flex
*
ERROR at line 1:
ORA-15067: command or option incompatible with diskgroup redundancy
SQL> exit
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0
[oracle@rac1-18c ~]$
alter diskgroup DATADG convert redundancy to flex
*
ERROR at line 1:
ORA-15067: command or option incompatible with diskgroup redundancy
SQL> exit
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0
[oracle@rac1-18c ~]$
So, added two disks each 50G to create new disk group for Flex Disk Group with "flex" redundancy.
[root@rac1-18c ~]# fdisk /dev/sdt
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x162353ae.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-104857599, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599):
Using default value 104857599
Partition 1 of type Linux and of size 50 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1-18c ~]#
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x162353ae.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-104857599, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599):
Using default value 104857599
Partition 1 of type Linux and of size 50 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1-18c ~]#
[root@rac1-18c ~]# fdisk /dev/sdu
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xbf260a36.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-104857599, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599):
Using default value 104857599
Partition 1 of type Linux and of size 50 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1-18c ~]#
[root@rac1-18c ~]# partprobe
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xbf260a36.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-104857599, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599):
Using default value 104857599
Partition 1 of type Linux and of size 50 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1-18c ~]#
[root@rac1-18c ~]# partprobe
[root@rac1-18c ~]#
Add newly created disks to "udev" rules.
[root@rac1-18c ~]# cat /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB861bb2e9-be7dc0d5", SYMLINK+="ocr-vote1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB204d9b3b-60370229", SYMLINK+="ocr-vote2", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB8f0b98f4-0ef900d1", SYMLINK+="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB6076c35e-1767e318", SYMLINK+="asm-disk2", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB91e4a118-d6f53c31", SYMLINK+="asm-disk3", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBe90328b2-f577014f", SYMLINK+="asm-disk4", OWNER="oracle", GROUP="dba", MODE="0660"
[root@rac1-18c ~]#
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB861bb2e9-be7dc0d5", SYMLINK+="ocr-vote1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB204d9b3b-60370229", SYMLINK+="ocr-vote2", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB8f0b98f4-0ef900d1", SYMLINK+="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB6076c35e-1767e318", SYMLINK+="asm-disk2", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB91e4a118-d6f53c31", SYMLINK+="asm-disk3", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBe90328b2-f577014f", SYMLINK+="asm-disk4", OWNER="oracle", GROUP="dba", MODE="0660"
[root@rac1-18c ~]#
[root@rac1-18c ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdt
1ATA_VBOX_HARDDISK_VB6cb5e9c3-30138903
[root@rac1-18c ~]#
1ATA_VBOX_HARDDISK_VB6cb5e9c3-30138903
[root@rac1-18c ~]#
[root@rac1-18c ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdu
1ATA_VBOX_HARDDISK_VBb6990eec-e7c8ccd7
[root@rac1-18c ~]#
1ATA_VBOX_HARDDISK_VBb6990eec-e7c8ccd7
[root@rac1-18c ~]#
[root@rac1-18c ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
[root@rac1-18c ~]#
[root@rac1-18c ~]#
[root@rac1-18c ~]# cat /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB861bb2e9-be7dc0d5", SYMLINK+="ocr-vote1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB204d9b3b-60370229", SYMLINK+="ocr-vote2", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB8f0b98f4-0ef900d1", SYMLINK+="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB6076c35e-1767e318", SYMLINK+="asm-disk2", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB91e4a118-d6f53c31", SYMLINK+="asm-disk3", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBe90328b2-f577014f", SYMLINK+="asm-disk4", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB6cb5e9c3-30138903", SYMLINK+="asm-disk5", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBb6990eec-e7c8ccd7", SYMLINK+="asm-disk6", OWNER="oracle", GROUP="dba", MODE="0660"
[root@rac1-18c ~]#
[root@rac1-18c ~]# /sbin/partprobe /dev/sdt1
[root@rac1-18c ~]#
[root@rac1-18c ~]# /sbin/partprobe /dev/sdu1
[root@rac1-18c ~]#
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB861bb2e9-be7dc0d5", SYMLINK+="ocr-vote1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB204d9b3b-60370229", SYMLINK+="ocr-vote2", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB8f0b98f4-0ef900d1", SYMLINK+="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB6076c35e-1767e318", SYMLINK+="asm-disk2", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB91e4a118-d6f53c31", SYMLINK+="asm-disk3", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBe90328b2-f577014f", SYMLINK+="asm-disk4", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB6cb5e9c3-30138903", SYMLINK+="asm-disk5", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBb6990eec-e7c8ccd7", SYMLINK+="asm-disk6", OWNER="oracle", GROUP="dba", MODE="0660"
[root@rac1-18c ~]#
[root@rac1-18c ~]# /sbin/partprobe /dev/sdt1
[root@rac1-18c ~]#
[root@rac1-18c ~]# /sbin/partprobe /dev/sdu1
[root@rac1-18c ~]#
Update Node-2 with two disks:
After Executing ASMCA, got the error saying that we need three minimum disk groups to setup FLEX Redundancy.
We need minimum three disks to create "FLEX" redundancy. See the error below.
So, creating one more additional disk for the disk group (FLEXDG).
[root@rac1-18c ~]# fdisk /dev/sdv
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xa55269ea.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-104857599, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599):
Using default value 104857599
Partition 1 of type Linux and of size 50 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1-18c ~]#
[root@rac1-18c ~]# partprobe
[root@rac1-18c ~]#
[root@rac1-18c ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdv
1ATA_VBOX_HARDDISK_VB90416f21-c627794e
[root@rac1-18c ~]#
[root@rac1-18c ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
[root@rac1-18c ~]#
[root@rac1-18c ~]# /sbin/partprobe /dev/sdv1
Created Disk group using FLEXDG
[oracle@rac1-18c ~]$ . oraenv
ORACLE_SID = [orcl] ? +ASM1
The Oracle base has been changed from /u01/app/oracle to /u01/app/grid
[oracle@rac1-18c ~]$ asmca &
[1] 16641
[oracle@rac1-18c ~]$
[1]+ Done asmca
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ asmcmd lsattr -G FLEXDG -l
Name Value
access_control.enabled FALSE
access_control.umask 066
appliance._partnering_type GENERIC
ate_conversion_done true
au_size 4194304
cell.smart_scan_capable FALSE
cell.sparse_dg allnonsparse
compatible.advm 18.0.0.0.0
compatible.asm 18.0.0.0.0
compatible.rdbms 18.0.0.0.0
content.check FALSE
content.type data
content_hardcheck.enabled FALSE
disk_repair_time 12.0h
failgroup_repair_time 24.0h
idp.boundary auto
idp.type dynamic
logical_sector_size 512
phys_meta_replicated true
preferred_read.enabled FALSE
scrub_async_limit 1
scrub_metadata.enabled TRUE
sector_size 512
thin_provisioned FALSE
vam_migration_done true
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ sqlplus / as sysasm
SQL*Plus: Release 18.0.0.0.0 - Production on Sun Oct 11 15:52:36 2020
Version 18.5.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0
SQL> set lines 100 pages 100
SQL> select name,type from v$asm_diskgroup where name='FLEXDG';
NAME TYPE
------------------------------ ------
FLEXDG FLEX
SQL>
[oracle@rac1-18c ~]$ . oraenv
ORACLE_SID = [+ASM1] ? orcl
The Oracle base has been changed from /u01/app/grid to /u01/app/oracle
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ dbca &
[1] 30650
[oracle@rac1-18c ~]$
Created Pluggable Database (PDB) placing on "FLEXDG" disk group
[oracle@rac1-18c ~]$ ps -ef | grep pmon
oracle 17580 1 0 15:43 ? 00:00:00 asm_pmon_+ASM1
oracle 19891 14248 0 16:08 pts/0 00:00:00 grep --color=auto pmon
oracle 19952 1 0 15:43 ? 00:00:00 apx_pmon_+APX1
oracle 20774 1 0 15:43 ? 00:00:00 ora_pmon_orcl1
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ . oraenv
ORACLE_SID = [orcl] ? +ASM1
The Oracle base has been changed from /u01/app/oracle to /u01/app/grid
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ ps -ef | grep pmon
oracle 7517 1 0 16:23 ? 00:00:00 ora_pmon_cdb11
oracle 11912 14248 0 16:29 pts/0 00:00:00 grep --color=auto pmon
oracle 17580 1 0 15:43 ? 00:00:00 asm_pmon_+ASM1
oracle 19952 1 0 15:43 ? 00:00:00 apx_pmon_+APX1
oracle 20774 1 0 15:43 ? 00:00:00 ora_pmon_orcl1
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ asmcmd lsfg
File Group Disk Group Quota Group Used Quota MB Client Name Client Type
DEFAULT_FILEGROUP FLEXDG GENERIC 0
CDB1_CDB$ROOT FLEXDG GENERIC 5336 CDB1_CDB$ROOT DATABASE
CDB1_PDB$SEED FLEXDG GENERIC 1648 CDB1_PDB$SEED DATABASE
CDB1_PDB FLEXDG GENERIC 1872 CDB1_PDB DATABASE
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ . oraenv
ORACLE_SID = [cdb11] ? cdb1
The Oracle base has been changed from /u01/app/grid to /u01/app/oracle
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ sqlplus sys/oracle@cdb1 as sysdba
SQL*Plus: Release 18.0.0.0.0 - Production on Sun Oct 11 16:34:04 2020
Version 18.5.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ WRITE NO
SQL>
SQL> alter pluggable database pdb save state;
Pluggable database altered.
SQL> exit
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ . oraenv
ORACLE_SID = [cdb1] ? +ASM1
The Oracle base has been changed from /u01/app/oracle to /u01/app/grid
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ asmcmd lsfg
File Group Disk Group Quota Group Used Quota MB Client Name Client Type
DEFAULT_FILEGROUP FLEXDG GENERIC 0
CDB1_CDB$ROOT FLEXDG GENERIC 5376 CDB1_CDB$ROOT DATABASE
CDB1_PDB$SEED FLEXDG GENERIC 1648 CDB1_PDB$SEED DATABASE
CDB1_PDB FLEXDG GENERIC 1896 CDB1_PDB DATABASE
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ . oraenv
ORACLE_SID = [+ASM1] ? cdb1
The Oracle base has been changed from /u01/app/grid to /u01/app/oracle
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ sqlplus sys/oracle@cdb1 as sysdba
SQL*Plus: Release 18.0.0.0.0 - Production on Sun Oct 11 16:36:31 2020
Version 18.5.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ WRITE NO
SQL>
SQL> alter session set container=PDB;
Session altered.
SQL> show con_name
CON_NAME
------------------------------
PDB
SQL>
SQL> alter pluggable database pdb prepare mirror copy pdbcopy;
Pluggable database altered.
SQL>
SQL> show user
USER is "SYS"
SQL>
SQL> show con_name
CON_NAME
------------------------------
PDB
SQL>
SQL> create pluggable database pdb_new from pdb using mirror copy pdbcopy;
Pluggable database created.
If you get an ORA-59003, wait a few minutes and try again. The error indicates that the copy is not ready to be split yet.
After finishing the above steps, a new independent file group and new PDB is created. Check the number of pdbs:
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ WRITE NO
4 PDB_NEW MOUNTED
SQL>
SQL> alter pluggable database pdb_new open read write instances=all;
Pluggable database altered.
SQL>
At this point, you can connect to PDB_NEW as a new database that was previously a copy of PDB.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ WRITE NO
4 PDB_NEW READ WRITE NO
SQL>
SQL> alter pluggable database pdb_new save state instances=all;
Pluggable database altered.
SQL>
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ WRITE NO
4 PDB_NEW READ WRITE NO
SQL>
SQL> exit
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ . oraenv
ORACLE_SID = [cdb1] ? +ASM1
The Oracle base has been changed from /u01/app/oracle to /u01/app/grid
[oracle@rac1-18c ~]$
[oracle@rac1-18c ~]$ asmcmd lsfg
File Group Disk Group Quota Group Used Quota MB Client Name Client Type
DEFAULT_FILEGROUP FLEXDG GENERIC 0
CDB1_CDB$ROOT FLEXDG GENERIC 5376 CDB1_CDB$ROOT DATABASE
CDB1_PDB$SEED FLEXDG GENERIC 1648 CDB1_PDB$SEED DATABASE
CDB1_PDB FLEXDG GENERIC 1896 CDB1_PDB DATABASE
PDBCOPY FLEXDG GENERIC 1896 CDB1_PDB_NEW DATABASE
[oracle@rac1-18c ~]$
Summary:
A flex disk group enables the creation of point-in-time database clones. When an ASM database clone is made, all the files associated with the database are split together and provide an independent database.
No comments:
Post a Comment