How To Export Only a Percentage Of Data In Tables Using The Datapump SAMPLE Parameter (Doc ID 1422064.1)

Last updated on FEBRUARY 27, 2012

In this Document
  Goal
  Solution
  References


Goal

This document explains how the SAMPLE command line parameter of Datapump Export can be used to retrieve only a percentage of the table data for export.

The SAMPLE parameter can prove very useful when e.g. a test database needs to be created which uses a subset of production data, and the amount of data in the production database is too large to handle. Smaller amounts of data make it easier to manage the testing, and this parameter allows extraction of a given percentage of the data from the tables.

The syntax of the command line parameter is:
SAMPLE=[[schema_name.]table_name:]sample_percent
where: Both schema_name and table_name are optional clauses. If schema_name is left out, then the table(s) are searched for in the schema of the user currently running the export session. If the table_name is left out, then the sample is done for all tables exported in the current session.

Note: if you specify schema_name, then table_name is also mandatory.

The sample_percent has no default value, so when used, a sample percentage must always be provided. It can range from from .000001 up to, but not including, 100.

Note: the sample_percent merely indicates the probability that a row will be selected as part of the sample. It does not mean that the database will retrieve exactly that amount of rows from the table.

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms