This section describes using the new, extend, and drop functions of the space service to manage storage spaces. chunksTo create or extend storage spaces you have to define chunks. infx offers several ways to manage the chunk files, which are described in the next section, 4. manage chunks, If your version of Informix supports it, you can assign these chunks to the storage pool. simple space managementFor this section of the guide, we will use the default infx instance, and create chunks as cooked files directly in the chunks directory. infx also has options to move the chunks to separate file systems or raw devices.
create storage spacesUse the new function of the space service to create storage spaces. Example, create a 100mb data storage space called dat01, on a new chunk file. The space will have the default page size. infx space func=new dbtype=data space=dat01 size=100 chunk=newinfx automatically created the new chunk file /infx/inst/infx01/chks/dat01.000, set permissions, and created the new storage space.
infx01@bobii:/home/informix>onstat -dIBM Informix Dynamic Server Version 11.50.FC7DE -- On-Line -- Up 00:53:47 -- 186936 KbytesDbspacesaddress number flags fchunk nchunks pgsize flags owner name4bb89028 1 0x60001 1 1 2048 N B informix root4d262e90 2 0x60001 2 1 2048 N B informix dat01 2 active, 2047 maximumChunksaddress chunk/dbs offset size free bpages flags pathname4bb8911c0 1 1 0 50000 3403 PO-B- /infx/inst/infx01/chks/root.0014d258328 2 2 0 50000 49947 PO-B- /infx/inst/infx01/chks/dat01.000 2 active, 32766 maximumNOTE: The values in the "size" and "free" columns for DBspace chunks are displayed in terms of "pgsize" of the DBspace to which they belong.Expanded chunk capacity mode: alwaysextending storage spacesUse the extend function of the space service to increase the size of an existing storage space. Example, add 50mb to the dat01 storage space, on a new chunk file infx space func=extend chunk=new size=50infx automatically created the new chunk file /infx/inst/infx01/chks/dat01.001, set permissions and extended the storage space. infx01@bobii:/home/informix>onstat -dIBM Informix Dynamic Server Version 11.50.FC7DE -- On-Line -- Up 00:55:32 -- 186936 KbytesDbspacesaddress number flags fchunk nchunks pgsize flags owner name4bb89028 1 0x60001 1 1 2048 N B informix root4d262e90 2 0x60001 2 2 2048 N B informix dat01 2 active, 2047 maximumChunksaddress chunk/dbs offset size free bpages flags pathname4bb891c0 1 1 0 50000 3403 PO-B- /infx/inst/infx01/chks/root.0014d258328 2 2 0 50000 49947 PO-B- /infx/inst/infx01/chks/dat01.0004d258b48 3 2 0 25000 24997 PO-B- /infx/inst/infx01/chks/dat01.001 3 active, 32766 maximumNOTE: The values in the "size" and "free" columns for DBspace chunks are displayed in terms of "pgsize" of the DBspace to which they belong.Expanded chunk capacity mode: alwaysYou can also extend the storage space by adding to the existing chunk. Example, add 50mb to the dat01 storage space, re-using the existing chunk file. infx space func=extend chunk=same size=50infx extended the storage space, using the last chunk that was allocated to it i.e. data01.001. It automatically calculated the required offset and added the chunk to the storage space. infx01@bobii:/home/informix>onstat -dIBM Informix Dynamic Server Version 11.50.FC7DE -- On-Line -- Up 01:04:20 -- 186936 KbytesDbspacesaddress number flags fchunk nchunks pgsize flags owner name4bb89028 1 0x60001 1 1 2048 N B informix root4d262e90 2 0x60001 2 3 2048 N B informix dat01 2 active, 2047 maximumChunksaddress chunk/dbs offset size free bpages flags pathname4bb891c0 1 1 0 50000 3403 PO-B- /infx/inst/infx01/chks/root.0014d258328 2 2 0 50000 49947 PO-B- /infx/inst/infx01/chks/dat01.0004d258b48 3 2 0 25000 24997 PO-B- /infx/inst/infx01/chks/dat01.0014d258d38 4 2 25000 25000 24997 PO-B- /infx/inst/infx01/chks/dat01.001 4 active, 32766 maximumNOTE: The values in the "size" and "free" columns for DBspace chunks are displayed in terms of "pgsize" of the DBspace to which they belong.Expanded chunk capacity mode: alwayssame or new, whats the difference?In most cases, you would extend storage spaces onto new chunk files. Provided you don't end up with hundreds and hundreds of chunks, there is no particular downside to having multiple chunks. Here is an example where using same makes more sense. Suppose I have three separate file systems for my storage spaces, and these represent different tiers of storage. For example, tier1 being fastest and tier3 being slowest. When I create storage spaces, I specify which file system I want the data to be stored on. For example: infx space func=new type=data space=fastdbs chunk=/tier1/infx01/fastdbsinfx space func=new type=data space=meddbs chunk=/tier2/infx01/meddbsinfx space func=new type=data space=slowdbs chunk=/tier3/infx01/slowdbsThis will create the following chunks and links:
Now, when you extend the space using the same keyword, the chunk files grow within their file systems.
Use the drop function of the space service to remove a storage space that is no longer in use. You cannot drop a storage space if it is still in use. Remove the dat01 storage space, if it is no longer in use. infx inst func=drop space=dat01Remove only one chunk of the storage space, if the chunk is no longer in use. Remove the chunk on dat01.001 with an offset of 50mb. infx inst func=drop space=dat01 chunk=dat01.001 offset=50mirroringTo create a mirrored storage space, or to extend a mirrored storage space, you must pass a mirror chunk name to the space service. infx automatically names mirror chunks the same way that it names primary chunks, with an "m" added at the beginning. space dat01 => mirror chunk /infx/inst/infx01/chks/mdat01.000The mchunk parameter behaves exactly like the chunk parameter. It supports the new and same keywords, as well as executing the INFXCHUNK script to create new chunks. This script will receive the mirror chunk name as its parameter. Create a mirrored storage space. infx space func=new space=new01 chunk=new mchunk=new size=100This command will create new chunks, new01.000 and mnew01.000. The infx space service also supports turning mirroring on and off, as well as changing chunk status See the space mirroring reference for more details. |
To use the Informix storage pool with the space service, specify chunk=pool, instead of using a chunk or the new/same keywords.