I must thank my fellow DBA Franky Weber Faust for his publication in his blog.

In this post I board a little more about the Flex Disk Group.

In the previous post we had started this subject, if you did not see check there

The purpose here is to show how to store a PDB in a Flex Disk Group. In this example we will store one of the tablespaces of the PDB pdb1 and compare it with the others.

With the oracle user, I point the environment variables to my orcl_2 instance:

[oracle@london1 ~]$ . oraenv
ORACLE_SID = [+ASM1] ? orcl_2
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/12.2.0.1/db_1
The Oracle base remains unchanged with value /u01/app/oracle

[oracle@london1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Jul 31 23:44:56 2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

We created the new PDB and pointed to the PDB1TBS tablespace to be stored in Disk Group Flex:

SQL> create pluggable database pdb1 admin user pdbadmin identified by oracle
default tablespace pdb1tbs datafile '+FLEX' size 200M autoextend off storage (maxsize 800M);

Pluggable database created.

Then we open PDB1:

SQL> alter pluggable database pdb1 open;

Pluggable database altered.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

Let’s see how the PDB1 files are left. Point the environment variables to the +ASM1 instance:

[oracle@london1 ~]$ . oraenv
ORACLE_SID = [orcl_2] ? +ASM1
The Oracle base remains unchanged with value /u01/app/oracle

Access asmcmd and list the orb database (CDB) and PDB1 datafiles to see the differences:

[oracle@london1 ~]$ asmcmd

ASMCMD> ls -ls +data/orcl/datafile/
Type Redund Striped Time Sys Block_Size Blocks Bytes Space Name
DATAFILE UNPROT COARSE JUL 31 23:00:00 Y 8192 70401 576724992 578813952 SYSAUX.263.950738671
DATAFILE UNPROT COARSE JUL 31 23:00:00 Y 8192 89601 734011392 736100352 SYSTEM.269.950738655
DATAFILE UNPROT COARSE JUL 31 23:00:00 Y 8192 26881 220209152 222298112 UNDOTBS1.266.950738675
DATAFILE UNPROT COARSE JUL 31 23:00:00 Y 8192 26881 220209152 222298112 UNDOTBS2.279.950819195
DATAFILE UNPROT COARSE JUL 31 23:00:00 Y 8192 641 5251072 6291456 USERS.267.950738737

ASMCMD> ls -ls +flex/orcl/55A934E3333E523BE0536538A8C03BD8/datafile/
Type Redund Striped Time Sys Block_Size Blocks Bytes Space Name
DATAFILE MIRROR COARSE JUL 31 23:00:00 Y 8192 25601 209723392 440401920 PDB1TBS.256.950831601

Note that in the Flex Disk Group the pdb1 PDB datafile was created with Mirror Redundancy and the orcl CDB datafiles that are in the Disk Group DATA are as Unprotected.

This is due to the standard redundancy of datafiles in a Flex Disk Group.

Querying information from the disk groups we find that the redundancy is of the Flex type:

SQL> select GROUP_NUMBER, NAME, STATE, TYPE, TOTAL_MB, FREE_MB, REQUIRED_MIRROR_FREE_MB, USABLE_FILE_MB from v$asm_diskgroup;

GROUP_NUMBER NAME STATE TYPE TOTAL_MB FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
------------ ---------- ----------- ------ ---------- ---------- ----------------------- --------------
1 CONFIG MOUNTED EXTERN 40960 6868 0 6868
2 DATA MOUNTED EXTERN 12288 8166 0 8166
3 FLEX MOUNTED FLEX 5120 4328 0 0

In this post we saw that to store a database, be it Non-CDB, CDB or PDB, we only need to inform the disk group. In the example presented we stored only one of the tablespaces of our PDB pdb1 in the disk group FLEX. In the next post we will see some more features of Flex Disk Groups.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.