• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 408
  • Last Modified:

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

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
ajaybelde
Asked:
ajaybelde
  • 4
  • 3
  • 2
1 Solution
 
Devinder Singh VirdiLead Oracle DBA TeamCommented:
You can use
1. copy command
2. use create table as select * from orig@dblink
0
 
Devinder Singh VirdiLead Oracle DBA TeamCommented:
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
 
johnsoneSenior Oracle DBACommented:
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
ajaybeldeAuthor Commented:
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
 
johnsoneSenior Oracle DBACommented:
Which command?  I see three distinct suggestions.  Can you tell us the full command that was used?
0
 
ajaybeldeAuthor Commented:
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
 
Devinder Singh VirdiLead Oracle DBA TeamCommented:
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
 
ajaybeldeAuthor Commented:
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
 
Devinder Singh VirdiLead Oracle DBA TeamCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now