Overview of Tape Operations
Precautions When Using Tape
The following precautions should be observed when carrying out tape operations in Reality.
- Ensure that tapes to be read are write protected (that is, remove the 'write ring' or set to 'write not enabled' position).
- Detach the tape using T-DET or CLEAR-ASSIGN immediately after writing data to prevent accidental overwriting.
- Use TCL commands such as T-REW and T-UNLOAD to move the tape rather than front panel controls.
- Do not use ctrl+break to stop system Procs that rewind the tape for you.
Attaching a Tape Unit
Before you can operate a tape unit from a terminal, the unit must be assigned to that terminal's port. Two commands are available to do this, ASSIGN and T-ATT. T-ATT only allows you to set up a single, default, data channel; ASSIGN supports the additional facility of defining multiple data channels for a single port.
Once a tape unit is assigned, it becomes unavailable for use from any other port. Any attempt to assign the tape unit by another port will result in a 'device is busy' message.
Tape Unit Numbers
The tape configuration for a Reality database is defined in
the database's config file,
and can be overridden by the
When you execute the ASSIGN or T-ATT command, you specify which unit(s) you want to use by entering the device number(s).
Data Channels
The ASSIGN command allows you to set up using one or more independent data channels for each terminal port, with different tape units identified by different tape unit numbers. A tape unit can be assigned to only one channel at a time.
If you do not specify a channel, the default channel is used. The T-ATT command is similar, but only allows you to set up the default channel.
You can set up the following parameters for each channel:
- Tape unit number attached.
- Record size to be transferred to/from tape
- Write density of data on the tape.
- The number of tape buffers to be used.
Default values are used for parameters that you do not specify.
Detaching a Tape Unit
When you have finished using a tape unit you must clear the channel assignment to the port, using the CLEAR-ASSIGN or T-DET command, to enable other database users to attach the tape unit.
Multiple Tape Units
Multiple tape units can be assigned to a data channel by specifying a list of unit numbers in the T-ATT or ASSIGN command. The list of units must also be specified in the Save Procs, such as, ACCOUNT-SAVE, FILE-SAVE and M-A-S. Tape unit 1 is used by default.
Attaching multiple tape units to a single channel enables more than one tape drive to be used for a single process. So, for example, suppose a FILE-SAVE requires two tapes and you want to run it unattended overnight, you can specify the two tape units at the FILE-SAVE prompt, load the tapes on the two units, then the FILE-SAVE proceeds automatically from one unit to the other. The FILE-SAVE Proc invokes T-ATT to assign the two units.
Sequencing of Tape Units
The software uses the units given in the unit list in the order in which they are specified. When the EOT marker on a tape is reached, the tape is rewound and the tape unit is switched off-line. Tape operations then continue with the next tape unit in sequence on the list. When the tape on the last tape drive in the unit list is finished, the software returns to the first tape unit in the list again and tries to use it again.
If the first drive unit is ready when the software tries to use it, the software assumes that a new tape is mounted and continues the tape operation. If the drive is not ready, the software displays the prompt:
MOUNT REEL# N ON DRIVE m
TYPE 'C' TO CONTINUE
Mount the next reel, then type C
to continue. The
software ignores all other entries except the character C
.
On completing the tape operation, the software 'remembers the unit it finished on, and commences subsequent operations on the same channel on that tape unit. This ensures one tape is filled before the next is started.
Error Messages
One of three messages may be displayed if the software encounters a problem when reading the first record on the next reel. They are:
REEL OUT OF SEQUENCE |
The reel number on the loaded tape does not match the requested reel. or The first tape mounted is not reel 1. |
WRONG LABEL! |
The tape label on a subsequent reel does not match the tape label on the first reel. |
UNLABELLED TAPE! |
An unlabelled tape is mounted when the first reel used was labelled. |
For each of the above message prompts, if you enter Y
, the
following prompt is displayed:
TYPE A(ACCEPT), S(SKIP) OR (QUIT)
The following responses can be entered:
A
To accept the label as a data record and resume read operations.
S
To skip the label and resume read operations.
Q
To exit to TCL.
Remote Tape
The remote tape feature allows Reality to use a tape unit attached to a remote system. The remote system can be any UNIX or Windows system that supports Reality (Reality does not need to be installed) and must be accessible via a TCP/IP LAN. It must also be running the Reality Remote Tape Server - this can be installed from the Reality CD (for details, refer to the Reality External Components Installation Guide).
To access a remote tape unit, you need to set up a tape definition for the tape server system. For details, refer to Remote Tape Device Definitions. Once a remote tape definition has been set up, the remote tape unit can be accessed in exactly the same way as a local tape unit.
Note
Before using remote tape for transferring large amounts of data, such as complete file saves, the available network bandwidth should be considered.
Tape Images
A tape image is an ordinary file that is used to emulate a Reality tape device (on UNIX it can also be a named pipe). This provides a method of saving Reality data to disk. Any file name may be used, but it is recommended that the .rti extension is used so that tape images can be easily identified. For compressed images (see below), you could use the extension .rci.
Reality tape image emulates tape operations as closely as possible. When accessing a normal file (not a pipe), all normal tape operations are supported (T-FWD, T-REW, T-WEOF, etc.). When using a pipe as a tape image, you can only move forwards through the image; commands that rewind the tape (such as T-BCK and T-REW) are not available.
Notes:
-
When accessing a tape image, a control file tracks the current position in the tape image. If you attach to a tape image, read a file, log off, log back on and re-attach to the tape image, you will be where you left off; that is, one file down the tape.
Always treat a tape image exactly as you would a real tape. If in doubt, do a T-REW before doing anything else.
- As with tape drives, a tape image can contain multiple tape files.
- Writing to a tape image will always write a full block, as it would to a tape drive. To save space in the image file use the compression feature described below.
Data Compression
If required, you can specify that the data saved in the tape image should be compressed. This can be done in the following ways:
- Set the database configuration parameter CompressTapeImage to the compression level required.
- Set the operating system environment variable REALCOMPTAPEIMAGE to the compression level required. This overrides any CompressTapeImage setting.
-
Modify the path to the tape image to specify the compression level. This can be done in the database configuration file, or by using the T-DEVICE command at TCL. Specifying the level in this way overrides any default set with the previous two methods.
To specify the tape image compression, append :clevel to the tape image filename when defining the tape device, where level is the required compression level. For example,
/tmp/filsave.rti:c8
sets the compression level to 8 for the file/tmp/filsave.rti
.
In all cases, the compression level must be a number from 0 to 9, where 0 is no compression (fastest) and 9 is maximum compression (slowest). The recommended compression level, optimising compression and performance, is 2. Compression is performed at the tape block level, so when using compression always use the maximum tape block size allowed to maximise compression.
The default is no compression, for compatibility with older versions of Reality. Note, however, that a compressed tape image cannot be read by versions of Reality earlier than V9.1. Reality V9.1 and later can read any tape image, whatever the compression level.
File Size Limit
If necessary, you can specify a maximum size for your tape image file. When the maximum size is reached, a new file is started, thus dividing the tape image into multiple files. This might be necessary if:
- The host file system has a maximum file size; for example, Windows FAT file system, which has a maximum file size of 2 Gigabytes.
- The files will be archived on a medium with a limited capacity; for example, CDROM, which has a maximum capacity of 650 Megabytes.
The use of multiple tape images is transparent to the Reality tape commands (see Tape Operation and Commands).
To specify a maximum file size, append :ssize
to the filename, where size is the required maximum size. You can
specify size in bytes or, by appending the appropriate suffix (K,
M or G), in Kilobytes, Megabtyes
or Gigabytes. For example,
/tmp/filsave.rti:s650M
sets the maximum size to 650 Megabytes for the
file filsave.rti.
When you specify a maximum file size, the file name is used as a template for a series of names, as follows:
-
If your file name includes one or more question marks (?), these are replaced by a sequence number. For example, if you specify C:\temp\img??.rti, the file names used will be
C:\temp\img01.rti
C:\temp\img02.rti
C:\temp\img03.rti
etc. - If your file name does not include any question marks, the first file will use the name you have specified, and subsequent files will have sequence numbers appended to this file name. For example, if you specify C:\temp\img.rti, the file names used will be
C:\temp\img.rti
C:\temp\img.rti2
C:\temp\img.rti3
etc.
Data Encryption
If required, you can specify that the data you save should be
encrypted by
Reality, by including the id of an encryption key file item in the tape device
definition. For details, refer to
Tape
Definitions or the description of the
Note
The record size used with encrypted tape devices must be a multiple of 8.
Record Size
The ASSIGN and
When reading a tape, the record size contained in the tape label is used.
If an unlabelled tape is being used, or if it is positioned after the label then, depending on the operation, the record size you have specified may be used. However, if the size you have specified is less than the actual tape record size, read errors or truncation of records may result.
Notes:
- Tapes with record sizes larger than 31764 bytes cannot be read on versions of Reality earlier than V12.0.
- If saving data that will be restored on a different type of MultiValue system, you should not use a record size larger than 16384.
- If the label type is set to 1, the record size is automatically limited to a maximum of 31764 bytes.
- The record size used with encrypted tape devices must be a multiple of 8.
Tape Labels
It is recommended that you clearly label all tapes. Two types of label can be used to identify a tape:
- Paper label. This is simply an adhesive paper label stuck on the tape reel or cartridge and case, containing the written details about the tape. It is important that accurate and detailed paper labels are written and attached to both the tape reel itself and the tape case.
- Data label. This is stored as data on the tape itself. A data label comprises a pre-defined number of characters of user specified text, the time and date, the reel number, and the tape block size. Many of the Reality processors, such as the save commands and the Spooler, generate a data label first, when writing to tape. They also check for a data label when reading from tape.
Paper Label Details
The paper label should include:
- The command used to generate the tape. Different commands produce different tape formats which determine the restore options that can be used.
- For multiple tape reels, the number of the tape. For example, TAPE 1 OF 3.
- The tape record block length. For example, 16000.
- The release of Reality software used to perform the save.
- Tape write density. For example, 3200 bpi (bits per inch).
- Time and date of save.
Data Label Formats
Data labels on tape comprise user specified text, the time and date, the reel number and the tape block size. The label is created before the data is put on tape and can be read using the T-RDLBL command.
Two types of label are supported.
- Reality 50-byte label which allows 16 characters of user text (type 1). Allows you to write tapes that can be read on early proprietary versions of Reality. If used, the record size is automatically limited to a maximum of 31764 bytes.
- SMA standard 80-byte label (default) which allows 44 characters of user text (type 2).
Note
If the record size is larger than 32Kbytes, or the tape contains a physical backup created using SAVE-IMAGE or realdump, a modified SMA 80-byte label is used, which allows only 42 characters of user text.
You specify the type of label (type 1 or type 2) when you attach the tape unit with ASSIGN or T-ATT. If you have accepted the default or specified type 2, the modified format will be automatically used if necessary.
In all cases, if you perform a T-RDLBL or a T-READ, the label information is displayed as follows.
Label = TEST TAPE 2 12:25:10 08 Jul 2005
Blocksize = 8000 Reel 1
Note
If the tape is encrypted and/or compressed (tape image), this information is also displayed.
To see the label as it is actually recorded on tape, you must first use
ASSIGN with LABEL=0 (no label) specified,
then
A Type 1 label is displayed as follows:
_LTEST TAPE 1]12:45:12 08 Jul 2005^01^08000^_...........
User Time Date Reel Block
text no. size
A Type 2 label is displayed as follows:
_L 1F40 12:25:10 08 Jul 2005 TEST TAPE 2...^01
Block Time Date User Reel
size text no.
Label Suppression
Although not generally recommended, you can suppress label creation by using the T option with any command that causes tape output, or by attaching the tape unit using ASSIGN or T-ATT with a label-type of 0. This option is available to provide compatibility with very early Reality releases and for data transfer to other system types.
Multi-reel restores are not possible when a tape label is not defined. Also, the block size must be assigned when reading such tapes. An error results if you attempt to read a tape with an actual block size greater than the size assigned.