Oracle Study Notes: Use the expdp/impdp Data Pump to export/import data

Source: Internet
Author: User

Data Pump is a new function launched by Oracle 10g. The difference between expdp/impdp AND exp/imp is that exp/imp is a client tool and can be used either on the client or on the server. Expdp/impdp is a server tool and can only be used on the server.

Expdp parameter description

  1. [Oracle @ linux exp] $ expdp help = y
  2. Export: Release 10.2.0.4.0-ProductionOnWednesday, October, 2011 17:30:17
  3. Copyright (c) 2003,200 7, Oracle.AllRights reserved.
  4. The data pump export utility provides a method for transferring data between Oracle databases.
  5. Data Object mechanism. The utility can be called using the following command:
  6. Example: expdp scott/tiger DIRECTORY = dmpdir DUMPFILE = scott. dmp
  7. You can control the export running mode. The specific method is as follows:'Expdp'Enter
  8. Parameters. To specify parameters, use the Keyword:
  9. Format: expdp KEYWORD = value or KEYWORD = (value1, value2,..., valueN)
  10. Example: expdp scott/tiger DUMPFILE = scott. dmp DIRECTORY = dmpdir SCHEMAS = scott
  11. Or TABLES = (T1: P1, T1: P2). If T1 is a partitioned table
  12. USERID must be the first parameter in the command line.
  13. Keyword description (default)
  14. ------------------------------------------------------------------------------
  15. ATTACH connects to an existing job, for example, ATTACH [= job name].
  16. COMPRESSION reduces the size of valid dump files
  17. Keyword values: (METADATA_ONLY) and NONE.
  18. CONTENT specifies the data to be detached. The valid keyword is:
  19. (ALL), DATA_ONLY and METADATA_ONLY.
  20. DIRECTORY is the DIRECTORY object used by dump files and log files.
  21. The list of DUMPFILE target dump files (expdat. dmp,
  22. For example, DUMPFILE = scott1.dmp, scott2.dmp, dmpdir: scott3.dmp.
  23. ENCRYPTION_PASSWORD is the key word used to create an encryption column.
  24. ESTIMATE calculates the estimated job value. The valid keyword is:
  25. (BLOCKS) andSTATISTICS.
  26. ESTIMATE_ONLY calculates the estimated job value without executing the export operation.
  27. EXCLUDE to EXCLUDE specific object types, such as EXCLUDE =TABLE: EMP.
  28. FILESIZE specifies the size of each dump in bytes.
  29. FLASHBACK_SCN is used to set the session snapshot back to the SCN in the previous state.
  30. FLASHBACK_TIME is used to obtain the SCN time closest to the specified time.
  31. FULLExport the entire database (N ).
  32. HELP displays the HELP message (N ).
  33. INCLUDE includes specific object types, such as INCLUDE = TABLE_DATA.
  34. The name of the export job to be created in JOB_NAME.
  35. LOGFILE log File Name (export. log ).
  36. The name of the remote database to which NETWORK_LINK is linked.
  37. NOLOGFILE does not write log files (N ).
  38. PARALLEL changes the number of active workers of the current job.
  39. PARFILE specifies the parameter file.
  40. QUERY is the predicate clause used to export a subset of a table.
  41. The percentage of data to be exported in SAMPLE;
  42. List of schemes to be exported by SCHEMAS (logon scheme ).
  43. When the default value (0) shows the new STATUS when available,
  44. The frequency (in seconds) job status to be monitored.
  45. TABLES identifies the list of TABLES to be exported-There is only one solution.
  46. TABLESPACES identifies the list of TABLESPACES to be exported.
  47. TRANSPORT_FULL_CHECK verifies the storage segments of all tables (N ).
  48. TRANSPORT_TABLESPACES: List of tablespaces from which metadata is to be detached.
  49. The VERSION of the object to be exported. The valid keyword is:
  50. (COMPATIBLE), LATEST or any valid database version.
  51. The following commands are valid in interactive mode.
  52. Note: abbreviations are allowed.
  53. Command description
  54. ------------------------------------------------------------------------------
  55. ADD_FILE adds a dump file to the dump set.
  56. CONTINUE_CLIENT returns to record mode. If the job is idle, the job is restarted.
  57. EXIT_CLIENT exits the Client Session and keeps the job running.
  58. The default file size (in bytes) of the subsequent ADD_FILE command ).
  59. HELP summarizes interactive commands.
  60. KILL_JOB separates and deletes jobs.
  61. PARALLEL changes the number of active workers of the current job.
  62. PARALLEL = <number of workers>.
  63. START_JOB start/restore the current job.
  64. When the default value (0) shows the new STATUS when available,
  65. The frequency (in seconds) job status to be monitored.
  66. STATUS [= interval]
  67. STOP_JOB closes the executed job in sequence and exits the client.
  68. STOP_JOB = IMMEDIATE will be closed immediately
  69. Data pump operation.

The Data Pump must depend on the directory.

  1. SQL> showUser
  2. USERIs"SYS"
  3. SQL>CreateDirectory expAs '/U01/exp';
  4. The directory has been created.

Full mode Export

  1. Expdp system/oracle @ orcl directory = expFull= Y

User Mode Export

  1. Expdp system/oracle @ orcl directory = exp schemas = ing dumpfile = demo1.dmp logfile = demp1.log

Tablespace mode Export

  1. Expdp system/oracle @ orcl directory = exp tablespaces = test01

Table mode Export

  1. Expdp system/oracle @ orcl directory = exp tables = ing. dept
  1. [Oracle @ linux exp] $ ll
  2. Total 100
  3. -Rw-r----- 1 oracle oinstall 94208 10-05 expdat. dmp
  4. -Rw-r-- R -- 1 oracle oinstall 1090 10-05 export. log

Estimate the export time instead of actual export

  1. Expdp system/oracle @ orcl directory = expFull= Y estimate = blocks estimate_only = y
  1. Expdp system/oracle @ orcl directory = expFull= Y estimate =StatisticsEstimate_only = y

Export only data rows

  1. Expdp system/oracle @ orcl directory = exp schemas = ing content = data_only

Export object definitions only

  1. Expdp system/oracle @ orcl directory = exp schemas = ing content = metadata_only

Exclude specific object Export

  1. Expdp system/oracle @ orcl directory = exp schemas = ing exclude =Table:\"= \ 'Test \'\"

Contains specific objects for export

  1. Expdp system/oracle @ orcl directory = exp schemas = ing include =Table:\"Like \ 'de % \'\"

Export with where

  1. Expdp system/oracle @ orcl directory = exp schemas = ing query = ing. test :\"Where rownum \ <3 \"
  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.