HELPLIB.HLB  —  SET  FILE  /AI_JOURNAL
    Requires read (R), write (W), and control access. Being the owner
    of the file is one way to get control access.

    Marks one or more RMS files for after-image journaling. You can
    also specify certain characteristics of the journal with this
    command, including its file specification, whether it is to be
    created, its initial size, and its default extension quantity.
    The SET FILE/NOAI_JOURNAL command unmarks a file for after-image
    journaling.

    The SET FILE command is not supported for remote files. You
    must use the SET FILE command from the system where the file
    is located.

    For more information, see the RMS Journaling documentation.

    Format

      SET FILE/[NO]AI_JOURNAL=(FILE=journal-filespec[,...])

                             data-filespec[,...]

1  –  Parameter

 data-filespec[,...]

    Identifies the file to be marked for after-image journaling. If
    you specify more than one file, separate the file specifications
    with commas. The asterisk (*)  and the percent sign (%) wildcard
    characters are allowed. The file specification cannot include a
    node name, since the SET FILE command is not valid for network
    access.

2  –  Description

    The SET FILE/AI_JOURNAL command marks one or more RMS files
    for after-image journaling. You can also specify certain
    characteristics of the journal with this command, including its
    file specification, whether it is to be created, its initial
    size, and its default extension quantity. The SET FILE/NOAI_
    JOURNAL command unmarks a file for after-image journaling. After
    a data file is marked for after-image journaling with the SET
    FILE/AI_JOURNAL command, the following events occur whenever the
    file is opened by RMS for write operations:

    o  The journal is opened.

    o  All subsequent modifications to the data file are recorded in
       the journal.

                                   NOTE

       To be able to recover the data file at a later time,
       you must make a backup copy of the data file, even if it
       contains no data.

    You must use the FILE keyword to specify a journal. By default,
    any portions of the file specification that you omit will be the
    same as the data file that is to be journaled, but with the file
    type RMS$JOURNAL. That is, if you issue the following command,
    then, by default, the file specification for the after-image
    journal is JOURNAL_DISK:PAYROLL.RMS$JOURNAL:

    $ SET FILE/AI_JOURNAL=(FILE=JOURNAL_DISK:) FINANCE_DISK:PAYROLL.DAT

    You should always keep the journal for after-image applications
    on a different volume from that of your data file. If recovery
    becomes necessary, you will be able to perform after-image
    recovery only if a backup copy of the data file is available.
    Use the FILE keyword to specify the journal location.

    Use the SET FILE/NOAI_JOURNAL command to unmark a file for after-
    image journaling. After you use the SET FILE/NOAI_JOURNAL command
    for a file, modifications to that data file will no longer be
    written to the journal.

    You must use the SET FILE/NOAI_JOURNAL command before you can
    delete a file that has been marked for after-image journaling.

3  –  Keywords

    Four keywords are used as parameters to the SET FILE/AI_JOURNAL
    command: ALLOCATION, [NO]CREATE, EXTENSION, and FILE. You must
    always use the FILE keyword; you can also use any, all, or none
    of the other three keywords.

    Use an equal sign (=)  immediately after the SET FILE/AI_JOURNAL
    command to use a keyword. If you use more than one of the
    keywords, enclose the list in parentheses and separate the items
    in the list with commas.

 ALLOCATION=n

    Specifies the initial size, in blocks, of the journal. The
    ALLOCATION keyword is meaningful only when the CREATE keyword
    is also used.

    The default allocation is 0 blocks.

 CREATE

    Specifies that a new journal is to be created. If no journal
    exists, using this keyword creates a new one. If a journal (with
    the file specification given in this command) already exists,
    using this keyword creates a new version of the journal. In the
    latter instance, the data file named in this SET FILE command
    is journaled to the new journal. Any other files that are being
    journaled to the previous version of the journal will continue to
    be journaled to that previous version.

    If a journal does not already exist, be sure to use the CREATE
    keyword with the SET FILE/AI_JOURNAL command. If you do not
    specify the CREATE keyword and the file that you specify with
    the FILE keyword does not exist, a journal will not automatically
    be created and an error message is displayed.

    When you create a journal for after-image journaling, the file
    protection for the journal is determined as follows:

    o  If a version of the journal that you specify with the CREATE
       keyword already exists, then the new version of the journal
       has the same file protection and access control list (ACL) as
       the most recent version.

    o  If there is no existing journal (that is, if you are creating
       version 1 of the journal), then the file protection and
       ACL of the journal are the default file protection for the
       process that creates the journal, except that none of the four
       ownership categories (system, owner, group, world) is given
       delete access.

    Also, every time that you use the CREATE keyword, be sure to make
    a backup copy of the data file. (If it is the first time that
    the data file is marked for after-image journaling, then you must
    make a backup copy of the data file, regardless of whether the
    CREATE keyword is used.)

                                   NOTE

       To be able to recover the data file at a later time, you
       must mark the file for journaling, and then make a backup
       copy of the data file, even if it contains no data.

    In most cases (in particular, when you are using after-image
    journaling to protect against loss of data from a device
    failure), you should keep the backup copy on a different volume
    from the data file. If recovery becomes necessary, you will be
    able to perform after-image recovery only if a backup copy of the
    data file is available.

    If you want to use a single journal for both after-image and
    before-image journaling, do not use the CREATE keyword with both
    the /AI_JOURNAL and /BI_JOURNAL qualifiers, because that will
    create two separate journals. When you create a journal that
    will be used for more than one data file or more than one type
    of journaling (after-image or before-image), you should first
    use a SET FILE command to create the journal for a single type
    of journaling and for a single data file. After the journal is
    created, then you can use a single SET FILE command for multiple
    data files and both after-image and before-image journaling. For
    example, you might use the following sequence of commands:

    $ SET FILE/AI_JOURNAL=(FILE=JNL_DISK:,CREATE) [WEEKLY]SALES.DAT
    $ SET FILE/BI_JOURNAL=(FILE=JNL_DISK:[WEEKLY]SALES) -
    _$INVOICES.DAT,COMMISSIONS.DAT

 EXTENSION=n

    Specifies the default extension quantity, in blocks, for the
    journal. You can specify a value from 0 to 65,535.

    The EXTENSION keyword is meaningful only when you use the CREATE
    keyword. If the file is extended, the value that you specify is
    used. If you do not use the EXTENSION keyword when you create a
    journal, RMS calculates its own EXTENSION value for the journal.

 FILE=journal-filespec

    Specifies the journal where all modifications to the named data
    file will be recorded. The default file specification for the
    journal is the file specification of the data file that you name,
    but with a file type of RMS$JOURNAL. If you provide a partial
    file specification for the journal, any unspecified portions are
    taken from the default file specification. The FILE keyword is
    required when you use the SET FILE/AI_JOURNAL command.

    If you are using after-image journaling to protect against the
    loss of data due to a device failure (such as a head crash),
    you should keep the journal on a different volume from the
    one on which the data file is kept. Only by keeping the data
    file and journals on separate volumes can you use after-image
    recovery to restore the data file if its recording medium becomes
    corrupted (for example, by a disk head crash). If you issue the
    SET FILE/AI_JOURNAL command and the journal is on the same volume
    as the data file being marked for after-image journaling, the
    INVAIJDEV warning message is issued.

    The file specification cannot include a node name, since the SET
    FILE command is not valid for network access.

    You can use a single journal for multiple data files for after-
    image journaling, and you can also use a single journal for both
    after-image and before-image journaling.

4  –  Qualifier

4.1    /LOG

       /LOG
       /NOLOG (default)

    Controls whether the SET FILE command displays the file
    specification and the type of journaling that has been set. By
    default, this information is not displayed.

5  –  EXAMPLES

    1.$ SET FILE /AI_JOURNAL=(FILE=JOURNAL_DISK:,CREATE) -
      _$FINANCE_DISK:[PAYROLL]WEEKLY.DAT

      In this example, the file FINANCE_DISK:[PAYROLL]WEEKLY.DAT is
      marked for after-image journaling. The required FILE keyword
      is used to place the journal on the disk JOURNAL_DISK, and
      the CREATE keyword generates a new version of the journal.
      The file specification for the journal will be JOURNAL_
      DISK:[PAYROLL]WEEKLY.RMS$JOURNAL.

      The next step in the after-image journaling process after
      issuing this command is to back up the data file.

    2.$ SET FILE/AI_JOURNAL=(FILE=JOURNAL_DISK:,CREATE)/LOG SALES.DAT
      %SET-I-JCREATED, journal JOURNAL_DISK:[REGION_1]SALES.RMS$JOURNAL;1
      created
      %SET-I-FILMARKAI, FINANCE_DISK:[REGION_1]SALES.DAT;1 marked for RMS
      after-image journaling
      -SET-I-JFILE, using journal JOURNAL_DISK:[REGION_1]SALES.RMS$JOURNAL;1
      %SET-I-MODIFIED, FINANCE_DISK:[REGION_1]SALES.DAT;1 modified

      In this example, the file SALES.DAT in default directory
      FINANCE_DISK:[REGION_1] is marked for after-image journaling
      and the /LOG qualifier causes the result of the SET FILE
      command to be displayed on the terminal.

    3.$ SET FILE/AI_JOURNAL=(FILE=JNL_DISK:,CREATE)/LOG  OVERDUE.DAT
      %SET-I-JCREATED, journal JNL_DISK:[PAYABLE]OVERDUE.RMS$JOURNAL;1
      created
      %SET-I-FILMARKAI, WORK_DISK:[PAYABLE]OVERDUE.DAT;1 marked for RMS
      after-image journaling
      -SET-I-JFILE, using journal JNL_DISK:[PAYABLE]OVERDUE.RMS$JOURNAL;1
      %SET-I-MODIFIED, WORK_DISK:[PAYABLE]OVERDUE.DAT;1 modified

      $ SET FILE/BI_JOURNAL=(FILE=JNL_DISK:)/RU_JOURNAL/LOG  OVERDUE.DAT
      %SET-I-FILMARKBI, WORK_DISK:[PAYABLE]OVERDUE.DAT;1 marked for RMS
      before-image journaling
      -SET-I-JFILE, using journal JNL_DISK:[PAYABLE]OVERDUE.RMS$JOURNAL;1
      %SET-I-FILMARKRU, WORK_DISK:[PAYABLE]OVERDUE.DAT;1 marked for RMS
      recovery-unit journaling
      %SET-I-MODIFIED, WORK_DISK:[PAYABLE]OVERDUE.DAT;1 modified

      In this example, the file OVERDUE.DAT is marked for all three
      types of journaling using two SET FILE commands. A single
      journal (JNL_DISK:[PAYABLE]OVERDUE.RMS$JOURNAL) will be used
      for after-image and before-image journaling.

      The first SET FILE command uses the /CREATE
      qualifier to create a new after-image journal,
      JNL_DISK:[PAYABLE]OVERDUE.RMS$JOURNAL. The file specification
      uses the current default directory [PAYABLE] and the default
      file extension RMS$JOURNAL.

      The second SET FILE command checks the disk JNL_DISK to see
      whether a journal already exists, and uses the existing journal
      for before-image journaling, as well as after-image journaling.

    4.$ SET FILE/NOAI_JOURNAL/NOBI_JOURNAL -
      _$ WORK_DISK:[PAYABLE]OVERDUE.DAT,VENDORS.DAT

      In this example, the files OVERDUE.DAT and VENDORS.DAT are
      unmarked for both after-image and before-image journaling. It
      is not necessary to specify the journals that were used. If
      more than one journaling type was applied to the data files
      (as in the previous example), then you must cancel each of the
      journaling types before you can delete the data files.

    5.$ SET FILE/AI_JOURNAL=(FILE=JOURNAL_DISK,CREATE)-
      _$ /RU_JOURNAL [FIELD]SALARY.DAT
      $ SET FILE/AI_JOURNAL=(FILE=JOURNAL_DISK:[FIELD]SALARY)-
      _$ /RU_JOURNAL CHECKS.DAT

      In this example, the files SALARY.DAT and CHECKS.DAT are both
      marked for after-image and for recovery unit journaling. The
      after-image journaling for both files is written to the same
      journal, JOURNAL_DISK:[FIELD]SALARY.RMS$JOURNAL.
Close Help