Creating an sbspace with -Ed and -En options

This topic explains externally stored large objects and their behavioral trends and restrictions.

Creating a Sbspace with the -Ed and -En Option

Smart large objects can also be stored externally in directories of a user’s choice. This can be done using -Ed and -En options of onspaces utility.

Example 1:
onspaces -c -S ext_sbsp -p /chunk_dir/chunk1 -o 0 -s 1000 -Ed /sb1 -Ed /sb2 -Ed /sb3 -Ed /sb4
Sbspaces will be created as :
/sb1/IFMXSB0
/sb2/IFMXSB0
/sb3/IFMXSB0
/sb4/IFMXSB0
Example 2:
onspaces -c -S ext_sbsp -p /chunk_dir/chunk2 -o 0 -s 1000 -Ed /sb1 -En 3
Sbspaces will be created as :
/sb1/IFMXSB0
/sb2/IFMXSB1
/sb3/IFMXSB2

Directory semantics

Directories and sub-directories will have owner ‘informix’, group ‘informix’, and permissions 770.

Sub-directories will have naming convention IFMXSB[0 to <numsubdirs> - 1]

ONCONFIG restrictions on external large objects

External subspaces are not allowed to be used in the given list of onconfig parameters. They will be dynamically changed by the server using onmode and onspaces.

SBSPACENAME will be set to default (empty string)

SYSSBSPACENAME will be set to default (empty string)

SBSPACETEMP will be pruned from the list

CDR_QDATA_SBSPACE will be pruned from the list

There are three scenarios to consider here.
  1. Bringing up the server with any of these set to an existing external sbspace:
    Example:
    
    12:23:50 External SBLOBspace sb_ext1 cannot be used by Onconfig parameter SBSPACETEMP. 
    12:23:50 Onconfig parameter SBSPACETEMP modified from sb3:sb4:sb_ext1 to sb3:sb4. 
    12:23:50 External SBLOBspace sb_ext1 cannot be used by Onconfig parameter SBSPACENAME. 
    12:23:50 Onconfig parameter SBSPACENAME modified from sb_ext1 to . 
    12:23:50 External SBLOBspace sb_ext1 cannot be used by Onconfig parameter SYSSBSPACENAME. 
    12:23:50 Onconfig parameter SYSSBSPACENAME modified from sb_ext1 to . 
    12:23:50 External SBLOBspace sb_ext1 cannot be used by Onconfig parameter CDR_QDATA_SBSPACE. 
    12:23:50 Onconfig parameter CDR_QDATA_SBSPACE modified from sb3,sb4,sb_ext1 to sb3,sb
    
    
  2. Using onmode -wm/-wf to dynamically change these ONCONFIG parameters:
    Example:
    onmode -wm SBSPACETEMP=sb3:sb4:sb_ext1
    External SBLOBspace sb_ext1 cannot be used by Onconfig parameter SBSPACETEMP. 
    
    onmode -wm SBSPACENAME=sb_ext1 
    External SBLOBspace sb_ext1 cannot be used by Onconfig parameter SBSPACENAME. 
    
    onmode -wm SYSSBSPACENAME=sb_ext1 External SBLOBspace sb_ext1 cannot be used by Onconfig parameter SYSSBSPACENAME. 
    
    onmode -wm CDR_QDATA_SBSPACE=sb3:sb4:sb_ext1 
    Configuration Parameter to be changed is not valid or not supported with this option
    
    
  3. Trying to add an external sbspace that has an onconfig settting with the same name. The space will be added, but the onconfig parameters will be adjusted.
    Example:
    onspaces -c -S sb_ext2 -p /sb_ext2 -o 0 -s 20000 -Ed /sbdir2 
    Verifying physical disk space, please wait ... 
    Space successfully added. 
    External SBLOBspace sb_ext2 cannot be used by Onconfig parameter SBSPACETEMP. 
    Onconfig parameter SBSPACETEMP modified from sb3:sb4:sb_ext2 to sb3:sb4. 
    External SBLOBspace sb_ext2 cannot be used by Onconfig parameter SBSPACENAME. Onconfig parameter SBSPACENAME modified from sb_ext2 to . 
    External SBLOBspace sb_ext2 cannot be used by Onconfig parameter SYSSBSPACENAME. Onconfig parameter SYSSBSPACENAME modified from sb_ext2 to . 
    External SBLOBspace sb_ext2 cannot be used by Onconfig parameter CDR_QDATA_SBSPACE. Onconfig parameter CDR_QDATA_SBSPACE modified from sb3,sb4,sb_ext2 to sb3,sb4. 
    
    ** WARNING ** A level 0 archive of Root DBSpace will need to be done.
    

Behaviour and restrictions on externally stored large objects

  • Bufferpool will not be used, hence the behavior of externally stored large objects is similar to traditional non-partition BLOBs.
  • Externally stored large objects can only be inserted, selected, and deleted.
  • Inserting a large object requires special attention. The intent for an insert is to allow a client to write the large object with an offset of 0 and a certain size. Once the large object is written, it cannot be appended. For example, there are client APIs ifx_lo_write() and ifx_lo_writewithseek(). Only a single call to these APIs is allowed and subsequent calls on the same large objects will not be allowed.
  • Truncates are not allowed.
  • New large objects will be inserted with round robin logic for directories and sub-directories.
    1. Start with the first directory.
    2. Insert one large object per sub-directory from 1 to num_subdirs.
    3. Move to the second directory.
    4. Insert one large object per sub-directory from 1 to num_subdirs.
    5. Repeat until all directories have been inserted and then start over with the first directory.
  • The server only knows about the location of the large objects. So, all the maintenance, storage, backup, recovery, etc is handled by the DBA.
  • If DBA removes a file that is needed by a SELECT, that large object column will return NULL.
  • If DBA removes a file that is needed by a DELETE, the server will silently ignore this since it is trying to delete a file that has already been deleted.
  • If DBA has an existing file that conflicts with an INSERT, an error will be thrown as this should never happen.
  • Rolling back an INSERT will remove the large object. Rolling back a DELETE is unaffected as the delete is not performed until COMMIT time.
  • HDR replication will not replicate the large object. Only the meta data will be replicated. So, the DBA is responsible for replicating the large object to the same directory on the HDR secondary.
  • onspaces usage will only show the -Ed and -En options when setting RASHELP=1 environment variable.
  • ER will not be allowed to replicate tables that contain columns stored in external subspaces.
  • Indexes with access methods will not be allowed to be stored in external sbspaces. Some of the blades use this technique, and this will not be supported.
    create index new1_idx on bts_tab(col2 bts_varchar_ops) using bts in ext_sbspace;
    12250: Smart Large Objects: This action is not supported for External Smart Blobs
     172: ISAM error: Unexpected internal error