19.1.11

SAP Note 18236 - R3trans: Export to tape / Splitting the export

Symptom:

Customer wants to export data with R3trans. If there is not enough storage space on the hard disk, or if the export exceeds the maximum file length, the following possibilities are available:

  • Write the export directly onto the tape.
  • Split or compress the export with "R3chop" (as of 3.0B).
  • For a client transport you can also use a remote copy as of Release 4.0.

Attention: This note is valid only until and including Release 4.0B. Note 86535 is valid as of Release 4.5.

Cause and prerequisites

Lack of space, limited maximum file length

Solution

The following solution works only for UNIX operating systems.

The 'named pipe' concept allows the exchange of data between two processes (on one computer), where one process writes to the pipe and the other reads that data. The 'named pipe' itself can be regarded as a file with a maximum length which can be rewritten to only once the reading process has completely read the contents already written.
In the following case R3trans writes to such a 'named pipe'; it is then read from by "dd" and written to tape or split into various files with "R3chop".

Usage of R3trans directly:

The filesplit is slightly easier when working directly with R3trans, therefore this case is described first. Nevertheless, please notice that exports and imports are normally performed by using the transport control program tp (see below).

Proceed as follows:

    1. For the export, you require an R3trans control file in which the file is specified, among other things:

export
file = '/usr/sap/trans/data/'

    2. Create the named pipe:

mknod /usr/sap/trans/data/ p

    3. Start the read process:

Export to tape:
dd if=/usr/sap/trans/data/ of= bs=16k &
or
Split and/or compress with "R3chop":
R3chop -ecf -p -l &
(For details on R3chop see Note 37626)

    4. Now start R3trans. It will write to the 'named_pipe' from which the process started in 3) will read.
    5. The import functions analogously:
    • Maintain the R3trans control file

import
file = '/usr/sap/trans/data/'

    • Create the 'named pipe' (if it does not already exist)
    • Start the process which writes to the pipe (dd or R3chop)

When you have split the export with R3chop into several files, then the corresponding command, would be, for example:

cat | R3chop -icsf /usr/sap/trans/data/

where are the files from the above parameter file of the R3chop (thus )

    • Start R3trans

Caution:
The processes 'dd' or 'R3chop' terminate as soon as R3tans has read in the named pipe once. Since R3 trans (or tp) could read in the named pipe more than once (namely if DD objects are contained in the transport), the write process ("dd" or "R3chop") might have to be started again.
This is done by entering the command "dd" or "R3chop" from step 5 as soon as R3trans is started a second time (can be seen from the message written after stdout).

Using tp:

In principle, the same steps are necessary as described already for the direct use of R3trans. In contrast to the direct use of R3trans, you cannot influence the following when using tp:

  • When R3trans is started.
  • Which data file R3trans uses.

The consequences should be described here.

    1. Generate the transport request which is to be exported. When using Transaction SCC2 for client transport, tp is started automatically to execute the export. Since you still have to arrange for export to tape/ splitting the data file, cancel the process with 'kill -2" ( not 'kill -9'!!). For this, you must identify the tp process in the process list. While doing so, also investigate whether tp has already started the R3trans and then terminate this as well with 'kill -2'.
    2. Determine the name of the data file from the name of the transport request (example: 'C11KT00031').
      a) Append a period ('.') to the name of the request (example: 'C11KT00031').
      b) Remove the first three letters of the name and append these to the end (example: 'KT00031.C11').
      c) Change the first letter from 'K' to 'R' (example: 'RT00031.C11').
    3. Create the complete path of the data file from: your transport directory, the subdirectory 'data' and the name of the data file. Create a "named pipe' of this name:

mknod p

Example:

mknod /usr/sap/trans/data/RT00031.C11 p

    4. Start the reading process:
    Export to tape:
    dd if=/usr/sap/trans/data/ of= bs=16k &
    or splitting and/or compression with "R3chop":
    R3chop -ecf -p -1 &
    (For details on R3chop, refer to Note 37626)
    5. Start tp for export, for example:

tp export c11kt00031 u1 -Dtestimport=0

    6. Before importing, it may be necessary to enter a new buffer. For this, tp checks whether the data file exists. The 'named pipe' created instead is not sufficient. Before tp is called with the argument 'ADDTOBUFFER', you must either
      a) start up the process which writes to the 'named pipe' (dd oder R3chop) or
      b) delete the 'named pipe', create an empty file with the name of the data file and recreate the 'named pipe' after the 'ADDTOBUFFER'. Example:

cd /usr/sap/trans/data

rm RT0031.C11

touch RT00031.C11

tp addtobuffer c11kt00031 p11 pf=/usr/sap/trans/bin/TPPARAM

rm RT00031.C11

mknod RT00031.C11 p

    7. Start tp for import.
    8. Whenever you see on the screen that R3trans appears (maximum twice for an import), start the process which writes to the 'named pipe' (dd or

When you have split the export with R3chop into several files, then the corresponding command, for example, would be:

cat | R3chop -icsf /usr/sap/trans/data/

where are the files from the above parameter file of the R3chop (thus )



Problems:

    1. Ensure that the processes involved in this procedure have the corresponding (read and write) authorizations for the 'named pipe'.
2. The R3chop program is no longer delivered in Release 4.0A/B. To also enable the functions described in this note for Release 4.0A/B, the R3chop for Release 4.0 is made available on the sapservX in the directory ~ftp/general/R3server/patches/rel40B/UNIX/. Refer to Note 19466 for details on how to retreive this program.

No comments:

Post a Comment