Index   Search   Add FAQ   Ask Question  

Oracle Import/ Export FAQ

$Date: 26-Jan-1999 $
$Revision: 1.2 $
$Author: Frank Naudé $

Topics

  • What is import/export and why do I need it?
  • Can one monitor how fast a table is imported?
  • Can one beat the 2 Gigabyte Unix file limit for export files?
  • How can one improve Import/ Export performance?
  • Common Import/ Export problems

  • Back to Oracle FAQ Index

    What is import/export and why do I need it?

    The Oracle export (EXP) and import (IMP) utilities are used to perform logical database backup and recovery. They are also used to move Oracle data from one machine or database to another.

    Unlike Oracle's SQL*Loader, the Export and Import utilities uses the SQL layer for data transfer and are therefor slower. The export utility can be effectively used, however, to detect database corruption and eliminate fragmentation. The DBA may want to perform exports of selected database tables to tape, for example, at longer intervals (multi-tape exports specified with tape volume size), especially if there are doubts regarding the reliability of the hardware. An export provides a minimal check of the hardware by ensuring that all the data can be read (some problems are not caught, however, unless the data is actually imported).

  • Back to top of file

  • Can one monitor how fast a table is imported?

    If you need to monitor how fast rows are imported from an import job, try one of the following methods:

    Method 1:

      select substr(sql_text,14,instr(sql_text,'(')-16) table_name,
             rows_processed,
             round((sysdate-to_date(first_load_time,'yyyy-mm-dd hh24:mi:ss'))*24*60,1) minutes,
             trunc(rows_processed/((sysdate-to_date(first_load_time,'yyyy-mm-dd hh24:mi:ss'))*24*60)) rows_per_min
      from   sys.v$sqlarea
      where  sql_text like 'INSERT INTO "%'
        and  command_type = 2
        and  open_versions > 0
    
    For this to work you need Oracle 7.3 or higher (7.2 might also be OK).

    If your import has more than one table, this statement will only show information about the current table being imported.

    Contributed by Osvaldo Ancarola, Bs. As. Argentina.

    Method 2:

    Use the FEEDBACK=n parameter as part of the IMP command. This command will let IMP displays a dot for every n rows imported.

  • Back to top of file

  • Can one beat the 2 Gigabyte Unix file limit for export files?

    Some Unix platforms are still limited to 2 Gigabyte files. This FAQ explains how to overcome this limitation.

    Create a compressed export on the fly. Depending on the type of data, you probably can export up to 10 gigabytes to a single file.

    This example uses gzip. It offers the best compression I know of, but you can substitute compress, zip, or whatever.

            # create a named pipe
            mknod exp.pipe p
            # read the pipe - output to zip file in the background
            gzip < exp.pipe > scott.exp.gz &
            # feed the pipe
            exp userid=scott/tiger file=exp.pipe ...
    
    That is all there is to it. Contributed by Jared K Still

    Read the Oracle/Unix FAQ for more examples on using Unix pipes.

  • Back to top of file

  • How can one improve Import/ Export performance?

    EXPORT: IMPORT: Contributed by Petter Henrik Hansen.

  • Back to top of file

  • Common Import/ Export problems

  • Back to top of file

  • General: Home | Index | Preamble | Glossary | OraCorp | Papers | Fun | News | Events | Y2000 | Books | Links | Forums
    Products: SQL | Plus | Loader | PL/SQL | PreComp | OPO | OMO | OO4OLE | DBA | PQO | PSO | OCO | Net | ODBC | WebServer | Des2k | Dev2k
    Systems: MVS | Unix | Windows | WindowsNT | NetWare | VMS