modify chunk swap_mirror argument: Switch primary and mirror chunk files without any downtime(SQL administration API)

Use the modify chunk swap_mirror argument with the admin() or task() function to easily migrate data from old disk drives to new ones without downtime.

Read syntax diagramSkip visual syntax diagram
>>-EXECUTE FUNCTION--+-admin-+---------------------------------->
                     '-task--'   

>--(--"--modify chunk swap_mirror--"--,--"--chunk_number--"--)-- ;-><

Element Description Key Considerations
chunk_number The number of the chunk. The chunk must be mirrored. Both the primary and the mirror chunk must be on-line.

Usage

To migrate data in a chunk from one disk drive to another on the fly, do the following:
  1. Add a mirror chunk to the original, primary chunk, placing the mirror on the new disk drive.
    Note: All chunks in a mirrored space must be mirrored.
    For more information see, onspaces -m or add mirror SQL administration API command.
  2. Swap the primary chunk and the mirror using the modify chunk swap_mirror command.
  3. Drop the mirror chunk (the original primary) by turning off mirroring for the space. For more information see, onspaces -r or stop mirroring SQL administration API command.

Example

EXECUTE FUNCTION sysadmin:task("create dbspace","newdbs","/prod1/IFX_CHUNKS/chunk5",10000,0);
EXECUTE FUNCTION sysadmin:task("add mirror","newdbs","/prod1/IFX_CHUNKS/chunk5",0,"/prod8/IFX_CHUNKS/chunk1",0);
select chknum from sysmaster:syschunks where fname = "/prod1/IFX_CHUNKS/chunk5";
EXECUTE FUNCTION sysadmin:task("modify chunk swap_mirror", "12");
EXECUTE FUNCTION sysadmin:task("stop mirroring","newdbs");

Copyright© 2020 HCL Technologies Limited