My Oracle Support Banner

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

Last updated on AUGUST 04, 2018

In this Document


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:
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.


To view full details, 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 a vibrant support community of peers and Oracle experts.