Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Data transfer question?

Re: Data transfer question?

From: Yassir Khogaly <yassir_at_khogaly.freeserve.co.uk>
Date: Thu, 19 Nov 1998 07:56:06 -0000
Message-ID: <730j3m$coe$1@newsreader1.core.theplanet.net>


If your OS is UNIX, Then here we go....

EXPORTING TO TAPE ON UNIX PLATFORMS



==

In this document you will find instructions on how to perform an export to tape on UNIX platforms either directly or by using unix named pipes.

It will discuss in detail the following considerations:

        o Why do you need to export to tape?
        o How do you calculate the size of your export?
        o Exporting directly to tape.  (An example is provided.)
        o How do you export to tape via unix named pipes?
        o How do you create a compressed export file?
        o How do you export to a remote tape device?
        o How do you perform export/import over the network using named
          pipes?

It should be noted that this document is based on the work of Khaled Kassis, Oracle US and John Benford, Oracle UK.


==
============================================================================
==


o Why do you need to export to a tape ?

        Export to tape is not a preferred practice, but it may be necessary
        for the following reasons:

        o  Lack of disk space  - you do not have enough disk space to
perform
           the export to a disk.

        o  If your export file will be greater than 2 Gigabytes - There is a
           unix restriction of 2G on the size of a file.


----------------------------------------------------------------------------
-

o How to calculate the size of your export?

        If the site is unsure how large a resultant export file will be, they

        can use the following commands to calculate its size:

(1) Create a unix named pipe:

            % mknod /tmp/exp_pipe p

(2) Start the export in the background, specifying the named pipe as

            the output file:

            % exp file=/tmp/exp_pipe <other options> &

(3) Next, dd in from the named pipe, out to /dev/null in 1K blocks:

            % dd if=/tmp/exp_pipe of=/dev/null bs=1024

(4) This will return the size of the export file in 1K blocks as

            follows:

            <no. of 1K blocks>+0 records in
            <no. of 1K blocks>+0 records out

----------------------------------------------------------------------------
--

o Exporting directly to tape.

        Once you have decided that you need to perform the export directly to

        tape, you will need to change the syntax of your export statement so
        that export knows the name of the tape device and how much data can
be
        written to that tape device.

        There are only 2 parameters that you need to change to do this:

        -  FILE - The name of the tape device you are exporting to
           e.g. /dev/rmt/0 .

        -  VOLSIZE - The amount of data that can be written to one tape.

        Considerations:

        -  If the entire export file will fit onto a single tape, then a
           volsize of 0 (variable length) can be used
                (e.g. exp <other options> volsize=0)
        -  If the resultant export file is larger than a single tape, then
           volsize needs to be set accordingly
                (e.g. exp <other options> volsize=<size>M)

           Please note, there is a 4 Gigabyte limit to the volsize
parameter.
        ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

                  AN EXAMPLE OF EXPORTING DIRECTLY TO TAPE

        ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

(1) os> exp userid=scott/tiger full=y file=/dev/rmt/0M volsize=145M

(3) os> imp userid=scott/tiger full=y file=/dev/rmt/0M volsize=145M



--

o How do you export to tape via unix named pipes?

On some Oracle platforms/versions there may be difficulties with exporting directly to tape using the Oracle export utility. In these cases, you may need to perform the export to tape via unix named pipes.

A unix named pipe is a FIFO special file, created using the unix mknod command. The syntax of the mknod command may change from port to port. It is
important, therefore, that you consult your systems manual.

Please note: Exporting via a named pipe (to tape or disk), is slower than using export directly. This is because of the size limit of a unix named pipe (usually 8K).

                os> mknod /tmp/exp_pipe p

        2. Next, dd in from the named pipe, out to the tape device, in the
                   background :

                os> dd if=/tmp/exp_pipe of=<tape device> &

        3. Start the export, specifying the named pipe as the output file:

                os> exp file=/tmp/exp_pipe <other options>


                os> mknod /tmp/imp_pipe p

        2. Next, dd in from the tape device, out to the named pipe, in the

           background :

                os> dd if=<tape device> of=/tmp/imp_pipe &

        3. Start the import, specifying the named pipe as the input file :

                os> imp file=/tmp/imp_pipe <other options>

----------------------------------------------------------------------------
--

o How do you create a compressed export file?

If you have calculated the size of the file your export will produce and it is too large to fit onto disk, you may want to consider producing a compressed export file as an alternative to exporting directly to tape.

Please note, this method should be thoroughly tested before being implemented.

                os> mknod /tmp/exp_pipe p

        2. Start compress in the background reading in from the named pipe,
           writing out to 'export.dmp.Z' :

                os> compress < /tmp/exp_pipe > export.dmp.Z &

        3. Start the export, specifying the named pipe as the output file :

                os> exp file=/tmp/exp_pipe <other options>

                os> mknod /tmp/imp_pipe p

        2. Start uncompress in the background reading from 'export.dmp.Z',
           writing out to the named pipe :

                os> uncompress < export.dmp.Z > /tmp/imp_pipe &

        3. Start the import, specifying the named pipe as the input file :

                os> imp file=/tmp/imp_pipe <other options>

        Please Note:
        ============

        You cannot export directly to tape and compress.



----------------------------------------------------------------------------
--

o How do you export to a remote tape device?

You may want to perform an export directly to tape but you do not have a local tape drive on your machine. There is, however, a tape drive on another machine on the network, to which you have remote shell (rsh) access.

                os> mknod /tmp/exp_pipe p

        2. Next, dd in from the named pipe, and out to the remote tape
device
           via a remote shell :

                os> dd if=/tmp/exp_pipe | rsh <hostname> dd of=<file
or                          device> &

        3. Start the export, specifying named pipe as the output file :

                os> exp file=/tmp/exp_pipe <other options>

                os> mknod /tmp/imp_pipe p

        2. Start a remote shell, in the background  that dd's from the
remote
           tape, piping to the local named pipe :

                os> rsh <hostname> dd if=<file or device> | dd
                                   if=/tmp/imp_pipe &

        3. Start the import, specifying the named pipe as the input file :
                os> imp file=/tmp/imp_pipe <other options>

----------------------------------------------------------------------------
--

o How do you perform import/export over the network using named pipes?


Please note:

It is important that you verify that the named pipe is ready on each side before you start the process. Received on Thu Nov 19 1998 - 01:56:06 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US