Need Help in Exporting using DBMS_DATAPUMP

Hi,
I need a help in building the Procedure where I will use DBMS_DATAPUMP for Export purpose.
I have a scenario where there is TABLEA and TABLE B.
TABLE A structure:
CODE VARCHAR2(10),NAME VARHAR2(50)
TABLE B structure:
DEPT VARCHAR2(10),CODE VARCHAR2(10),DEPT_DESC VARCHAR2(40)
i want to take the dump of values in joining TABLE A nad TABLE B for e.g after joining I have the values as:
CODE NAME DEPT
10 SSSS TECH
20 PPPP ADMIN
Any help will be benefitial for me

This is clearly school work and you need to do it yourself.
The docs on DataPump are at http://tahiti.oracle.com and there are working demos in Morgan's Library at www.psoug.org.
One note though to you and your instructor. Learn to use this query:
SELECT keyword FROM v$reserved_words WHERE keyword = 'NAME';

Similar Messages

  • Schema Export using DBMS_DATAPUMP is extremely slow

    Hi,
    I created a procedure that duplicates a schema within a given database by first exporting the schema to a dump file using DBMS_DATAPUMP and then imports the same file (can't use network link because it fails most of the time).
    My problem is that a regular schema datapump export takes about 1.5 minutes whereas the export using dbms_datapump takes about 10 times longer - something in the range of 14 minutes.
    here is the code of the procedure that duplicates the schema:
    CREATE OR REPLACE PROCEDURE MOR_DBA.copy_schema3 (
                                              source_schema in varchar2,
                                              destination_schema in varchar2,
                                              include_data in number default 0,
                                              new_password in varchar2 default null,
                                              new_tablespace in varchar2 default null
                                            ) as
      h   number;
      js  varchar2(9); -- COMPLETED or STOPPED
      q   varchar2(1) := chr(39);
      v_old_tablespace varchar2(30);
      v_table_name varchar2(30);
    BEGIN
       /* open a new schema level export job */
       h := dbms_datapump.open ('EXPORT',  'SCHEMA');
       /* attach a file to the operation */
       DBMS_DATAPUMP.ADD_FILE (h, 'COPY_SCHEMA_EXP' ||copy_schema_unique_counter.NEXTVAL || '.DMP', 'LOCAL_DATAPUMP_DIR');
       /* restrict to the schema we want to copy */
       dbms_datapump.metadata_filter (h, 'SCHEMA_LIST',q||source_schema||q);
       /* apply the data filter if we don't want to copy the data */
       IF include_data = 0 THEN
          dbms_datapump.data_filter(h,'INCLUDE_ROWS',0);
       END IF;
       /* start the job */
       dbms_datapump.start_job(h);
       /* wait for the job to finish */
       dbms_datapump.wait_for_job(h, js);
       /* detach the job handle and free the resources */
       dbms_datapump.detach(h);
       /* open a new schema level import job */
       h := dbms_datapump.open ('IMPORT',  'SCHEMA');
       /* attach a file to the operation */
       DBMS_DATAPUMP.ADD_FILE (h, 'COPY_SCHEMA_EXP' ||copy_schema_unique_counter.CURRVAL || '.DMP', 'LOCAL_DATAPUMP_DIR');
       /* restrict to the schema we want to copy */
       dbms_datapump.metadata_filter (h, 'SCHEMA_LIST',q||source_schema||q);
       /* remap the importing schema name to the schema we want to create */     
       dbms_datapump.metadata_remap(h,'REMAP_SCHEMA',source_schema,destination_schema);
       /* remap the tablespace if needed */
       IF new_tablespace IS NOT NULL THEN
          select default_tablespace
          into v_old_tablespace
          from dba_users
          where username=source_schema;
          dbms_datapump.metadata_remap(h,'REMAP_TABLESPACE', v_old_tablespace, new_tablespace);
       END IF;
       /* apply the data filter if we don't want to copy the data */
       IF include_data = 0 THEN
          dbms_datapump.data_filter(h,'INCLUDE_ROWS',0);
       END IF;
       /* start the job */
       dbms_datapump.start_job(h);
       /* wait for the job to finish */
       dbms_datapump.wait_for_job(h, js);
       /* detach the job handle and free the resources */
       dbms_datapump.detach(h);
       /* change the password as the new user has the same password hash as the old user,
       which means the new user can't login! */
       execute immediate 'alter user '||destination_schema||' identified by '||NVL(new_password, destination_schema);
       /* finally, remove the dump file */
       utl_file.fremove('LOCAL_DATAPUMP_DIR','COPY_SCHEMA_EXP' ||copy_schema_unique_counter.CURRVAL|| '.DMP');
    /*EXCEPTION
       WHEN OTHERS THEN    --CLEAN UP IF SOMETHING GOES WRONG
          SELECT t.table_name
          INTO v_table_name
          FROM user_tables t, user_datapump_jobs j
          WHERE t.table_name=j.job_name
          AND j.state='NOT RUNNING';
          execute immediate 'DROP TABLE  ' || v_table_name || ' PURGE';
          RAISE;*/
    end copy_schema3;
    /The import part of the procedure takes about 2 minutes which is the same time a regular dp import takes on the same schema.
    If I disable the import completely it (the export) still takes about 14 minutes.
    Does anyone know why the export using dbms_datapump takes so long for exporting?
    thanks.

    Hi,
    I did a tkprof on the DM trace file and this is what I found:
    Trace file: D:\Oracle\diag\rdbms\instanceid\instanceid\trace\instanceid_dm00_8004.trc
    Sort options: prsela  execpu  fchela 
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    SQL ID: bjf05cwcj5s6p
    Plan Hash: 0
    BEGIN :1 := sys.kupc$que_int.receive(:2); END;
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        3      0.00       0.00          0          0          0           0
    Execute    229      1.26     939.00         10       2445          0          66
    Fetch        0      0.00       0.00          0          0          0           0
    total      232      1.26     939.00         10       2445          0          66
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: SYS   (recursive depth: 2)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      wait for unread message on broadcast channel
                                                    949        1.01        936.39
    ********************************************************************************what does "wait for unread message on broadcast channel" mean and why did it take 939 seconds (more than 15 minutes) ?

  • Need help in export/import

    Hello All,
    I need help in export/import of an  internal table (based on deep structure) to/from desktop either in excel or XML file.
    I have an int table which has to be sent to desktop either in xls or xml file and then import back to an internal table(with deep structure).
    Ex :
    Int table is based on structure.
    Structure has fields
    as
    f1 -
    f2 -
    f3 - table type
    Your help will be appreciated.

    Hi Nishant,
    Please put your question in below mention forum.
    SAP Business One SDK
    Thanks
    Mohammad Imran

  • Hello.  I need help.  I use Photoshop Elements 10 on my MAC but it no longer reads discs.  Can I download it from the internet with my original package serial number?

    Hello.  I need help.  I use Photoshop Elements 10 on my MAC but it no longer reads discs.  Can I download it from the internet with my original package serial number?  thanks

    Yes, from here:
    Download Photoshop Elements products | 13, 12, 11, 10

  • Need help how to use itunes card to download music

    Need help how to use itunes card to download music

    If you want to add the iTunes card to your account, then in the iTunes app on the iPad you should be able to scroll to the bottom of the Music tab and there should be a Redeem button - there is more info here : http://support.apple.com/kb/HT1574

  • I have lost the use of my extension pannels, and need help recovering the use. I get a message that extensions failed to load. Why?

    I have lost the use of my extension pannels, and need help recovering the use. I get a message that extensions failed to load. Why?

    I've had that before when on a really slow Internet connection.

  • Hii i need help i cannot use my apple id for download on app store because they say i need to verify my account but i don't know how so please somebody can help me? i try to resset my password but that don't help

    hii i need help i cannot use my apple id for download on app store because they say i need to verify my account but i don't know how so please somebody can help me? i try to resset my password but that don't help

    is it asking for ur security questions?

  • Need help trying to use close button and i really like to know why it off

    need help trying to use close button and i really like to know why it off

    And in English? You need to explain better.
    Mylenium

  • This is detailed: I lost my touch pad scroll ability on my desktop when I installed Firefox, I am having a terrible time trying to sync my new Android tablet to my desktop, my desktop Firefox is acting very strangly (I need help trying to use it)

    My Vista Home Premium desktop has not used Firefox for a long time. I just loaded it as well as on my Honeycomb Android. The statement that I made pretty much says what my problem is. I can use both of them at the same time and use a router with the air Verizon card installed.
    I'll repeat my question: This is detailed: I lost my touch pad scroll ability on my desktop when I installed Firefox, I am having a terrible time trying to sync my new Android tablet to my desktop, my desktop Firefox is acting very strangely (I need help trying to use it)

    My Vista Home Premium desktop has not used Firefox for a long time. I just loaded it as well as on my Honeycomb Android. The statement that I made pretty much says what my problem is. I can use both of them at the same time and use a router with the air Verizon card installed.
    I'll repeat my question: This is detailed: I lost my touch pad scroll ability on my desktop when I installed Firefox, I am having a terrible time trying to sync my new Android tablet to my desktop, my desktop Firefox is acting very strangely (I need help trying to use it)

  • I bought apps from apps store,my money was taken and den I downloaded the pass buh 2 didn't work .it told me iTunes failed to install app,the apps were the dark knight rises(batman) and asphalt 7 I need help plss am using iPad 2

    bought apps from apps store,my money was taken and den I downloaded the apps buh 2 didn't work .it told me iTunes failed to install app,the apps are the dark knight rises(batman) and asphalt 7 I need help plss am using iPad 2

    Although iTune terms says that all sales are final. You can try explaining to get a refund.
    http://www.apple.com/support/itunes/contact/

  • I need help with export settings

    Hi everyone,
    I need help outputting an HD file for presenting a video to a client. I have tried exporting to HD .mov (H.264 codec) and PE keeps crashing (error compiling movie). From what I’ve read here, it’s due to the gargantuan file QT creates and HD space (even though I think I have enough HD available).
    So, I need a recommendation from you on what kind of file to output which will allow me to present the movie to the client in HD. This file is solely for the presentation, I have already published for web (FLV) and YouTube (direct share from PE) and they both worked fine.
    Here are my project specs:
    Timeline:           4:26
    Format:               1920 X 1080 HD
    Timebase:          29.97 frames per second
    OS:                        Windows XP SP3
    Processor:          Intel Core 2 Duo @ 2.66GHz
    RAM:                    4GB
    Project Drive:   250GB disk with 152GB free space internal dedicated project drive (separate from OS)
    Thanks in advance for your help,
    Jose

    Hi Steve, Neale,
    I wanted to follow-up on this post. I came into the office today to run a few tests so I can make sure that I have the correct settings on my camera and PE project for the next time around. Here are few observations I was wondering if you can comment on:
    My Sony camera cannot shoot HDV. The only format it supports is AVCHD, so I'm stuck converting.
    I tried to convert the footage I have to HDV with the software I have (AVS Video Converter and Koyote Soft HD Converter) and neither of the two have an "HDV" conversion setting. I see AVI, MPEG, MOV and many different settings in each (AVI: Hd Video 1080p: H.264AVC, 29.97fps, 4200kbps, Audio MP3, 256 kbps or MPEG: HD Video 1080p - MPEG2, 15000 kbps, 1920X1080, 29.97fps, etc). What should I be looking for?
    I searched for "best file format" in the forum and found various postings from both of you referring to converting to DV-AVI within PE; especially if you have AVCHD footage (which I have). So, I followed directions and converted a file for testing. Then, I created a new project using HDV 1080i 30 settings and imported the converted file. I still get a red line on the timeline. Any thoughts on what I'm doing wrong?
    I also converted the MOV files (shot in HDV 60i with the pro camera) to DV-AVI. I also get a red line on the timeline...
    The DV-AVI converted footage (both cases) doesn't appear to be HD. It looks jagged on the preview window. Is it HD?
    The DV-AVI converted footage is almost double the file size as the MTS (AVCHAD) file (138mb vs. 60mb). Isn't that going to make PE run slower?
    Thanks in advance for your help. I just wanna make sure I do my homework now so I set everything up correctly on the next project.
    Jose
    P.S. I almost forgot! Here's the link to the live video on YouTube: http://www.youtube.com/watch?v=fEkqPmefJV0
    Message was edited by: josejb70 - Added YouTube link

  • Need help in FM used in IDOC

    Hi experts,
    Need help with IDOC. I'm creating 2 FM to process an existing idoc.
    first FM will use the data from idoc 1 to populate EDIDD for idoc 2.
    second FM will use the data from idoc 2 to populate EDIDD for idoc 3.
    when during processing, I encountered error message "No function module for input process code <second FM>".
    although i already link the FM to be used, why does FM 1 cannot call FM 2 directly?
    Thanks.

    In LSMW object attributes... give like this..
    Message Type         CREMAS                      Vendor master data distri
    Basic Type           CREMAS04                    Vendor master data distri
    Enhancement
    after that continue normal LSMW procedure.

  • Need help setting export options

    I'm working on replacing our old RDC component with the new Java SDK.
    I purchased Crystal Reports 2008 and downloaded the SDK.  Now I'm trying to run a simple example exporting a report to word.  I've built it off of the other export examples I've seen on the site.  None of them seem to give me an up to date example of how to set export options though.
    Exporting seems to work when I export using this:
    ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream) report.getPrintOutputController().export(ReportExportFormat.MSWord);
    But not when I do this:
    ExportOptions opt = new ExportOptions();
    opt.setExportFormatType(ReportExportFormat.MSWord);
    RTFWordExportFormatOptions myOptions = new RTFWordExportFormatOptions();
    opt.setFormatOptions(myOptions);
    ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream) report.getPrintOutputController().export(opt);
    Is there something I'm missing?  I want to be able to explicitly set my export options - especially for other export formats like excel.

    Unfortunately I must still be doing something wrong.  The csv is exported but it comes back with gibberish characters in the file instead of what is in my Crystal.  PDF comes back fine but the other export formats (xls, doc, csv, etc.) all come back with gibberish characters.
    Here is an example of the csv export code I'm using::
    ExportOptions opt = new ExportOptions();
    CharacterSeparatedValuesExportFormatOptions csvOptions = new CharacterSeparatedValuesExportFormatOptions();
    csvOptions.setSeparator(",");
    csvOptions.setDelimiter("\"");
    opt.setExportFormatType(ReportExportFormat.characterSeparatedValues);
    opt.setFormatOptions(csvOptions);
    ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream) report.getPrintOutputController().export(opt);
    I don't believe I can use ReportExportControl - it doesn't seem to be a part of the SDK I downloaded(but maybe I'm missing something) - I need the SDK version for Crystal Reports 2008.
    I do have Microsoft Office 2003.  Maybe this is causing issues?

  • Need Help with Formula using SQL maybe

    I need help!  I work with Crystal reports XI and usually manage just fine with the Formula editor but his one I think will require some SQL and I am not good at that.
    We are running SQL 2000 I think (Enterprise Manager 8.0)  Our sales people schedule activities and enter notes for customer accounts.  Each is stored in a separate table.  I need to find activities that are scheduled 240 days into the future and show the most recent note that goes with the account for which that activity is scheduled.
    The two tables, Activities and History, share the an accountID field in common that links them to the correct customer account.   I want to look at dates in the Startdate.Activities field more than 240 days in the future and show the most recent note from the History table where the accountid's match. I figure my query will contain a join on AccountID.Activities and AccountID.History used with Max(completedate.History) but I do not understand how to word it.
    I would like to perform all this in crystal if possible.  I humbly request your help.
    Membery

    You SQL would look something like this...
    SELECT
    a.AccountID,
    a.BlahBlahBlah, -- Any other fields you want from the Activities table
    h.LastComment
    FROM Activities AS a
    LEFT OUTER JOIN History AS h ON a.AccountID = h.AccountID
    WHERE (a.ActivityDate BETWEEN GetDate() AND DateAdd(dd, 240, GetDate()))
    AND h.HistoryID IN (
         SELECT MAX(HistoryID)
         FROM History
         GROUP BY AccountID)
    This method assumes that the History table has a HistoryID that increments up automatically each time a new comment is added... So a comment made today would always have a higher HistoryID that one made yesterday.
    If I'm wrong and there is no HistoryID or the HistoryID doesn't increment in a chronological fashion, it can still be done but the code is a bit more complex.
    HTH,
    Jason

  • Really need help (motor control using labview)

    hi all readers,
    im new beginner. really need help for my project. i've been assigned to monitor/control motor using labview 8.5 (using NI DAQmx). the problem is, the techinician told me that i cant use 3phase motor with this card. things that i need to displayed using labview is :
    torque
    power
    current
    voltage
    speed
    really appreciated if readers can help me with this:
    wut type of motor shud i use that compatible with NI DAQmx
    thanks a lot.

    Hi fauziana,
    NI data acquisition devices are primarily designed to take measurements, so it's a good idea to measure the signals that you have mentioned with a DAQ device.
    You also can use DAQ devices for control tasks, but for reliable and deterministic control behavioryou typically need to use a real-time operating system (not Windows!). If you want to learn more about the pros and cons of using DAQ devices for motion control tasks, please refer to these threads. Still for standard motion control tasks it's much more efficient in terms of development time, to use a dedicated motion control device for the motion control part of your application.
    In general the control part is independant from the motor type, as these devices only generate control signals (+/- 10 V). There are many power drives available, that accept this type of control signal and you should select your motor according to the requirements of your application.
    For a more detailed system consulting, please contact your local NI branch. To select the products that fit best to your application requirements a face to face discussion is much more efficient than a discussion forum thread, because there are a lot of parameters that need to be taken into consideration. If you tell me in which country you are living, I can provide appropriate contact data to you.
    Thanks and kind regards,
    Jochen Klier
    National Instruments

Maybe you are looking for