Product Documentation

FairCom RTG COBOL User Guide

Previous Topic

Next Topic

Upgrade files to RTG 5 attribute resource format (Unified Data Types)

FairCom RTG Version 5 introduced an extended resource format that allows nearly all FairCom Database features to be applied to RTG tables. These features include the JSON DB API, dbNotify, partitioned files hot alter table, replication, two-phase commit support, and full text search. To take full advantage of these features it is necessary to upgrade existing RTG tables created prior to RTG V5 to this new schema format.

RTG files created with V5 now default to this new extended resource format, and are identified as RTGIv2 by a new “RTG Resources” label. Files created by RTG V4 and prior are labeled as RTGIv1.

Identify file resource

You can obtain the RTG file resource version of an existing table by using ctutil -info. Look for “RTG resources” output:

ctutil -info

RTG resources : RTGIv1

Be sure to use only the version of ctutil included in your current RTG distribution, or you may not get the expected output.

Update File Resource in place

To upgrade to the latest RTG resource version, use ctutil -upgrade:

ctutil -upgrade <table> -ctattr

To confirm a successful upgrade, examine the ctutil -info output from that table after ctutil -upgrade completes, and make sure RTG version 2 information is displayed:

RTG resources : RTGIv2

Create a new file with updated File Resource

To convert an existing RTG file to a new file format while leaving the existing file in place, use this syntax:

ctutil -upgrade source_file [dest_file]

This process copies all the application data to a new file, so it can be a lengthy process for large files. RTGIv1 format file can still be used with older versions of RTG. RTG V5 can read both RTGIv1 and RTGIv2 file formats.

Upgrade tables with new table attributes

ctutil can also be used to add permanent features such as data compression, encryption, and the hot alter table support (flexrec) mode for future application schema revisions. Any options enabled in ctree.conf are applied during this upgrade:

ctutil -upgrade <table> <newtable>

File access during ctutil -upgrade

During the ctutil -upgrade operation, the source file will be opened with filmod = ctSHARED and xfilmod = ctXOPN_REDSHR. This allows other users to be able to open the file for read-only access (like ctutil -info does), but will prevent updating the file.

TOCIndex