Solved

Data Pump Script to Exclude a few tables out of thosands in a schema

Posted on 2009-05-18
7
620 Views
Last Modified: 2012-05-07
I request help in writing Data Pump commands to do the following:
1) Export a Schema, Schema_1 (This Schema has 2000 Tables)
2) Use the Export File Created in Step 1, to Import selected 10 tables and all associated objects into Schema _2
3) Use the Export File Created in Step 1, to Import the rest of the 1990 tables and all associated objects into Schema _3
0
Comment
Question by:KamalAgnihotri
7 Comments
 
LVL 10

Expert Comment

by:ravindran_eee
ID: 24418963
Make use of exclude/include parameters in Oracle data pump (assuming Oracle version is 10g)

http://www.oraclefaq.net/2007/03/09/expdp-datapump-excludeinclude-parameters/
0
 
LVL 48

Expert Comment

by:schwertner
ID: 24419292
Excluding indexes that start with EMP:
EXCLUDE=INDEX:LIKE EMP%

Excluding the SCOTT schema from a FULL export:
EXCLUDE=SCHEMA:=SCOTT

impdp DIRECTORY=tmp dumpfile=tetst2.dmp logfile=log2 REMAP_SCHEMA=surachart:chart
EXCLUDE=TABLE:\"= \'ADDRESS_BOOKS\'\"

Possibly in the last example you will be able to use SQL IN clause

EXCLUDE=TABLE:\"= \IN ('ADDRESS_BOOKS\')\"

0
 
LVL 7

Expert Comment

by:Piloute
ID: 24419321
Hi,

Check out the DataPump official doc here
http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/toc.htm

Go down into the docs for the actions like export and import and you have all the commands with examples.

Cheers,
P
0
 

Author Comment

by:KamalAgnihotri
ID: 24424291
The following worked for me:

impdp moment/*****@asc999 DIRECTORY=dpump_dir_009 DUMPFILE=MOM_ALL_033.dmp LOGFILE=impdp_MOM_minus_DC_009.log EXCLUDE=TABLE:"IN('DMS_CONTENT')"

However, my issue has not been resolved:

1) TabSpa_1 is the Tablespace for Schema_1 which 2000+ Tables. A few of them have LOB datatypes.
2) I want to seperate those 10 tables which have LOB DataTypes, into a new schema, Schema_2 having its own Tablespace TabSpa_2

I tried the DataPump and the Export/Import Utility and in both cases, the Import ends up going to TabSpa_1 Tablespace.

I think, it can be done. If not please let me know as well.

Kamal


0
 
LVL 48

Accepted Solution

by:
schwertner earned 125 total points
ID: 24424734
You can also move objects from one tablespace to another by using the REMAP_TABLESPACE option.
Example:
$ impdp
SCHEMAS=iself
REMAP_TABLESPACE=iself_tablespace:urself_tablespace

Many times though we want to import into a different schema and this is accomplished by the REMAP_SCHEMA option. Here is an example where we imported the DEPT table into a different schema.

C:\>impdp system/tiger REMAP_SCHEMA=SCOTT:JKOOPMANN DIRECTORY=datapump DUMPFILE=dept.dmp LOGFILE=dept.log

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Oracle SQL - Query help 7 78
form builder not starting 3 70
How to create an alias for a column name in ORACLE sql ? 2 45
oracle collections 2 27
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question