Solved

how to do export one table in one database to another database with partition on 17/08/2011

Posted on 2011-09-22
9
398 Views
Last Modified: 2012-05-12
i created a user in target

i have to do export one table with a partition specified on 17/08/2011 from another database.

then i have to import that table into another schema in another database.can u help me how to do it this, can u give me the commands.

0
Comment
Question by:ajaybelde
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 15

Accepted Solution

by:
Devinder Singh Virdi earned 500 total points
ID: 36581917
You can use
1. copy command
2. use create table as select * from orig@dblink
0
 
LVL 15

Expert Comment

by:Devinder Singh Virdi
ID: 36581932
syntax
1.
copy from username/pass@sourceDB create table using select * from tablename partition(p17082011);

2. Create database link db1 connect to username identified by pass using 'SOURCEDB'
    login to target
    create table tablename as select * from origtable@db1;
0
 
LVL 35

Expert Comment

by:johnsone
ID: 36581940
Check the documentation on expdp?  You can specify the partition you want to export with the TA BLES parameter:

http://download.oracle.com/docs/cd/E11882_01/server.112/e16536/dp_export.htm#i1006816
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:ajaybelde
ID: 36582893
i need to include indexes in the table.when i am using the above command the rows are inserted but there are no indexes i see in that table
0
 
LVL 35

Expert Comment

by:johnsone
ID: 36583002
Which command?  I see three distinct suggestions.  Can you tell us the full command that was used?
0
 

Author Comment

by:ajaybelde
ID: 36583031
syntax
1.
copy from username/pass@sourceDB create table using select * from tablename partition(p17082011);

2. Create database link db1 connect to username identified by pass using 'SOURCEDB'
    login to target
    create table tablename as select * from origtable@db1;
0
 
LVL 15

Expert Comment

by:Devinder Singh Virdi
ID: 36583086
Copy and Create table will not create indexes.
You can use
set long 99999
select DBMS_METADATA.GET_DDL('INDEX', index_name) from user_indexes where table_name ='TABLE_NAME';

take the output of above and execute in other env.
You also need to take care of constraints.

You can use INSERT instead of create if you want to create table first.
use DBMS_METADATA.GET_DDL('TABLE', ....
0
 

Author Comment

by:ajaybelde
ID: 36583128
how can i do the export and import to export the table with that partiton,and it also needs to include the indexes, can u tell me the command for doing the export and import please.
0
 
LVL 15

Expert Comment

by:Devinder Singh Virdi
ID: 36583392
you can use expdp with exclude option and provide the partition name that you dont want to provide

expdp username/pass@db directory=exp dumpfile=d.dmp exclude=TABLE_DATA:"IN('partion_you_dont_want')" reuse_dumpfiles=yes tables=your_table
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

734 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