1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How to import few columns from the exported table in oracle 12c

Discussion in 'Security, Backup and Recovery' started by sunil, Jan 29, 2016.

  1. sunil

    sunil Active Member

    Messages:
    51
    Likes Received:
    1
    Trophy Points:
    140
    Location:
    MICHIGAN
    Hi Zargon,
    Could you please help me in fixing this issue?
    Actually, The requirement is, one table has around 120 columns in prod environment and i have to import only 3 columns to the same table in the test environment. As the application team need only 3 column from the prod environment. So, i have to automate this process.
    Here, My question is, how to import only few columns from the exported table in the target side?
    The database version is 12.1.0.2 on both sides.

    Thanks,
    Sunil Gowda
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Your first step is to create a 'holding table' with just the columns you need:

    create table p as select a,g,x from z;

    Now you export P. Once that's done you import P into the destination database then run:

    insert into q (a,g,x)
    select * from p;

    Then you can drop P from both databases.