Different ways to copy data between two schemas in one instance

Hi there,
I am searching a good way to copy data between two schemas in the same instance.
Both schemas have an identical structure such as triggers, tables, views and so on. The only difference is the purpose: one is the productivity system and one is for development.
I looked at datapump but I do not explicit want to export / import. I want to keep the data in the productivity schema as well as copy it to the other schema. Any ideas? I found out there is a copy statement but I dont't know how that works.
Thank you so far,
Jörn

Thank you for your replies!
I also thought of creating a second instance for development and move the dev - schema to it. I just don't know whether our server can handle both (performance?). Anyway the idea is to have a possibility to quickly rebuild the data inside a schema without indixes or triggers, just pure data. I thought the easiest way would be to copy the data between the schemas as they are exactly the same. However if you tell me DataPunp is the best solution i won't deny using it :).
When you export data a file is created. does that also mean that the exported data is deleted inside the schema?
best regards
Jörn
Ps: Guido, you are following me, aren' t you? ;-)

Similar Messages

  • Compare table data between two schemas?

    Hi,
    I am looking for a script to compare the table data between the schemas (two different databases)? I know how to compare table by table but looking for a generic script where I can compare all the tables data from one schema to another schema?
    Thanks a lot...

    here the idea, adapt it with your needs :)
    Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.7.0
    Connected as SYS
    SQL> create user user1 identified by user1;
    User created
    SQL> grant create  session to user1;
    Grant succeeded
    SQL> grant create table to user1;
    Grant succeeded
    SQL> alter user user1 quota 10m on DATA;
    User altered
    SQL> create user user2 identified by user2;
    User created
    SQL> alter user user2 quota 10m on DATA;
    User altered
    SQL> grant create table to user2;
    Grant succeeded
    SQL> grant create  session to user2;
    Grant succeeded
    SQL> create table user1.test(a Number) tablespace DATA;
    Table created
    SQL> create table user2.test(a Number) tablespace DATA;
    Table created
    SQL> insert into user1.test values (1);
    1 row inserted
    SQL> insert into user1.test values (2);
    1 row inserted
    SQL> commit;
    Commit complete
    SQL> insert into user2.test values (2);
    1 row inserted
    SQL> commit;
    Commit complete
    SQL> create table sys.logs(Diff number) tablespace data;
    Table created
    SQL> select * from sys.logs;
          DIFF
    SQL>
    CREATE OR REPLACE PROCEDURE TEST_MY_DIFF IS
      CURSOR CUR_ IS
        SELECT D.TABLE_NAME T_NAME FROM DBA_TABLES D WHERE D.OWNER = 'USER1';
      W_DIFF NUMBER;
      TYPE CV_TYP IS REF CURSOR;
      CV CV_TYP;
    BEGIN
      EXECUTE IMMEDIATE 'TRUNCATE TABLE SYS.LOGS';
      FOR I IN CUR_ LOOP
        W_DIFF := 0;
        OPEN CV FOR 'select count(*)
    from
    ( select * from USER1.' || I.T_NAME || '
    minus
    select * from USER2.' || I.T_NAME || ' )
    union all
    ( select * from USER2.' || I.T_NAME || '
    minus
    select * from USER1.' || I.T_NAME || ')
        LOOP
          FETCH CV
            INTO W_DIFF;
          INSERT INTO SYS.LOGS VALUES (W_DIFF);
          COMMIT;
          EXIT WHEN CV%NOTFOUND;
        END LOOP;
      END LOOP;
    EXCEPTION
      WHEN OTHERS THEN
        NULL;
    END;
    SQL> BEGIN
      2  test_my_diff;
      3  end;
      4  /
    PL/SQL procedure successfully completed
    SQL> select * from sys.logs;
          DIFF
             1
             1

  • Moving data between two schemas

    I need to move data between to schemas. I have a created packaged code to accomplish this. The problem is the execution time. When running the insert statements from the source schema to insert data into the target schema, it takes considerably longer to complete the statement than if I copied the tables from the source schema into the target schema and executed the same statement in the target schema. Any insight as to why this might be?
    Also all data resides on the same physical disk, running version 10g on a W2K server.
    Thanks in advance
    Here is a sample of one of the insert statements:
    INSERT INTO target_table(tt_id, tt_disp, tt_date, tt_emp_1, tt_emp_2, tt_emp_3)
    SELECT src_tab.src_id,
    src_tab.scr_disp,
    src_tab.scr_date,
    src_tab.scr_emp_1,
    src_tab.scr_emp_2,
    src_tab.scr_emp_3
    FROM
    (SELECT
    row_number() over(
    ORDER BY SUBSTR(fn_cil_sort_format(SUBSTR(src_cil,
    1, 8)), 1, 4), SUBSTR(src_cil, 4, 8)) AS src_id,
    scr_disp,
    fn_date_format(date_time) AS scr_date,
    v_convert AS scr_emp_1,
    v_convert AS scr_emp_2,
    v_convert AS scr_emp_3
    FROM source_table
    ORDER BY SUBSTR(fn_sort_format(SUBSTR(src_cil, 1, 8)), 1, 4),
    SUBSTR(src_cil, 4, 8)) src_tab
    WHERE scr_disp IS NOT NULL;

    In addition to the above post, you should create the table initially with NOLOGGING. create table as select has the ability to bypass logging. This should increase performance very much. No log writes will have to be taking place.
    Lee

  • Copying data between two tables with different structures

    I have two tables. second table has three extra fields at the end. How can I copy data from first table to the other? I tried the following but it does not seem to work:
    INSERT INTO second_table ((select * from first_table),'text','text',5)
    Please help. Thanks

    INSERT INTO second_table SELECT col1, col2, col3, .., 'text', 'text', 5 FROM first_table;
    Cheers!
    r@m@

  • How to copy data between two tables row by row

    Hi All,
    I have three tables TableA and TableB and TableC
    I wanted to write a stored procedure to copy data row by row from TableA to TableB and then update TableC by replacing any record that has the old id (before copying) to the new id after copying the data.
    here is the steps 
    iterate throw all the rows in tableA ( probably with a foreach)
    in each iteration we will do the following:
    Get current ID (identity) for each record in TableA ( will call it @oldID)
    Insert the row in TableB
    Get the new ID for the row from TableB will call it (@NewID)
    find rows in tableC that has the (@oldID)
    replace all ids in tableC with @oldID to @NewID
    Thanks in advance

    0
    TableA and TableB are identical they should have the same columns 
    TableC columns will be ( ID, TableA_ID , Notes)

  • How to Communicat​e data between two applicatio​n (One in labview and other in C)

    Dear all i have two independent application running on same PC. One a C program & a Labview application.
    C program will pass some parameters to Labview application and waits for responce back from Labview.
    Labview should wait for data from C Program and when it gets that, it should process it and should return it back to C program....
    How a program can be made in labview to receive a data form Other appliaction
    I am using Labview 7.1.
    Abhimaniu

    This kind of communication works the best when the LabVIEW code is compiled into a DLL.
    In C you could call the DLL and the DLL would return the calculated values.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Copy tables between two different computer?

    Hi experts,
    I don't know if is this the correct place to make this question, but I need help with independent tables. Is it possible to copy independent tables to one 6.0 computer to other computer with the same version 6.0?
    Thanks in advance for your answers,
    Best Regards,
    Rebeca

    > We want to copy independent tables from one system in 6.0 to another system in 6.0. We have system A (that was in 4.7 and now is in 6.0) with data relative to Spain and another system, system 2,  that is also in 6.0 with data from other countries. In system B we have a particular mandant for Spain and the problem is that we want to include all the independent tables information from system A to system B and we don't know how to do that... is there anyway that we can do this?
    There is no standard way of putting data of two systems to one system together. It's not just copying tables around (many HR tables are cluster tables and can't be read through SQL without a logic on top) but also speaking of dependent things.
    The only supported way of doing such things is booking an SLO service and let SAP assist you in doing it. Only then you can be sure that it works as expected. But don't underestimate the whole thing. Check
    http://service.sap.com/slo
    --> Consolidate and unite system landscapes
    --> Optimization for HCM
    SAP has the tools and the knowledge to do such things and you can be sure it works. I would not do it on my own by copying tables (most HR tables are client dependent, you'd have to map client numbers, plants, adapt T512W and all that stuff manually).
    Markus

  • Copy Files Between Two Unix Computers

    Hi,
    I am trying to write a piece of code that will copy bunch of files from one Unix computer on to another Unix computer. On windows it seems to be pretty straight but on Unix I am trying to understand best way of copying the files. I don't have much expertise in Unix.
    Is using FTP the only option for Unix?
    I am not able to create a FILE object by referring to a file on some other Unix box? I tried new File("//unixbox2/temp/123.txt");
    Please let me know the different ways to copy files between Unix computers.
    Thanks
    Gautham

    This's a simple example of how you can send a file form one computer to another
    import java.io.*;
    import java.net.*;
    public class Prf extends Thread {
         public void run() { //Read form file and writer to socket
              try {
                   Thread.sleep(100);//sleep(100) while server is getting ready to accept connection
                   System.out.println("Connecting...");
                   Socket soc = new Socket("localhost",4070);
                   OutputStream outS = soc.getOutputStream();
                   FileInputStream fis = new FileInputStream("input.dat");
                   int i = 0;
                   byte[] b = new byte[1000000]; //1MB buffer
                   for(;;) {
                        i = fis.read(b); //read from file (i - number of read bytes)
                        if (i != -1) {// checking for end of data
                             outS.write(b,0,i); //write portion (0..i) of bytes to socket
                        } else {
                             break;
                   fis.close();
                   outS.close();
                   soc.close();
              } catch (IOException e) {
                   System.out.println(e.getMessage());
              } catch (InterruptedException e) {
                   System.out.println(e.getMessage());
         public static void main(String[] args) {//Read from socket and write to file
              Prf prf = new Prf();
              try {
                   ServerSocket sSoc = new ServerSocket(4070);
                   prf.start(); //start writer
                   Socket soc = sSoc.accept();
                   System.out.println("Connection's accepted");
                   InputStream inS = soc.getInputStream();
                   FileOutputStream fos = new FileOutputStream("output.dat");
                   int i = 0;
                   byte [] b = new byte[1000000]; //buffer
                   while (true) {
                        i = inS.read(b);//read from socket (i - number of read bytes)
                        if (i != -1) { //check for end of date
                             fos.write(b,0,i); //write portion (0..i) of bytes to file
                        } else {
                             break;
                   fos.close();
                   inS.close();
                   soc.close();
                   sSoc.close();
              } catch (IOException e) {
                   System.out.println(e.getMessage());
    }

  • What are the diffrent ways to copy data from one application to another?

    Hi,
    Can you guys tell me what are the different ways to copy data from one application to another application??
    I know we can do it through script logic using DESTINATION_APP.
    Is there any other way to copy data from one application to another application?
    Please help me
    Thanks,
    Charly

    You can also call a custom DTSX package in SSIS via the datamanager.
    there are at least 5 ways of transfering data in BPC between apps.
    1. Through the front end (excel etc) via evdre/evsnds
    2. Through Script logic using *Dest App
    3. Using BPC's standard export dtsx package via DM
    4. Using SSIS using BPC's custom SSIS tasks
    5. Through Script logic using stored procs.
    i am sure people will come up with more.
    remember if you use ssis and move data into any table but the wb, you need to process the cube afterwards.

  • Copy data between 2 localisations

    My client is using Sap business one 2007A. he has a database with localization "Spain". he created another database with UK localization. he needs to copy the accounting entries from the first to the other one. copy express doesnt allow to copy data between 2 localization (only settings). is there any way to copy data between 2 localizations

    You may export accounting entries from the first db and DTW to the second one.
    Thanks,
    Gordon

  • Copy data between cubes

    I need to copy data between two cubes (through a business rule). Can I do it using Partition/Replication? If so, does anyone have an example on how it is done? I'm currently using @XREF, but that does not transfer data for blocks that don't already exist in target database.
    I'm very new to this so a detailed description will help.
    Thanks for your help.

    Yes, partitions are great. I like to use replicated partitions because I can control the data, and deal with integrity issues etc. Your usage may vary.
    Basically, you go to your "Source" database, go to the partitions menu, and "Create New Partition". You then walk through each of the tabs in the partition menu
    Type Tab: Choose the type. Let's say a "replicated" partition.
    Connection Tab: Choose what databases will be connected with the partition
    Areas Tab: I like to check the "Use Text Editor" to just type out the formulas. Also check the "Show Cell Count" to have some confidence your formulas are working as planned. Here you define what data moves from source to target. For example I might setup the following
    Source:
    ("Actuals Data"),
    @LEVMBRS("Province",0),
    @GENMBRS("Company",2)
    Target:
    ("Actuals Data"),
    @LEVMBRS("Province",0),
    @GENMBRS("Company",2)
    If the names don't match, you can adjust that in the advanced properties or mapping properties. (If you have multiple slices of data - use the advanced mapping).
    Now validate and save

  • How to transfer app data between two different game center accounts?

    Hello, I really need some help.
    I have looked all over the web for ways to transfer apps between two different game center accounts and different devices. Several weeks ago I started playing Campus Life on my relative's Ipad 2, therefore spending many long hours to get to this point in the game.
    The problem is I just got an Iphone 5 and I really would like to transfer the data onto it, so that I would not need to start all over again.
    My grandma has an account (Game Center) onto which the data has been saved and I would like to have it stored onto mine. On some forum someone said to sign into the account which has the data on both devices and to then open up the game on the new device. It worked. Then I signed out and logged in with my own account- the game started from scratch. I panicked. I went back on the other account, and the data reappeared. I have been going back and forth, the game changing as many times. I thought it would ask to back up my grandma's data on mine but I was wrong. I can not seem to save the game onto my new account, and I have even tried to back it up to Itunes and then copy it onto my phone after having signed into my own account. And I don't know how to properly use Icloud. I am a mess. I am completely lost and have found no help on the web. (All people seem to have to deal with is sharing Apple IDs with different Game Center Accounts for the kids and transferring apps from one of their devices to another.)
    I am so worried I am going to mess up and will lose the whole thing completely.
    I have just started another game with my own account but since I am using my grandma's, the data is erased. It's one or the other but I definitely prefer saving Campus Life. I do not like the idea of having to only pick one.
    I do not know any technical terms, so if you understand or even have the slightest clue about what I am talking about, I applaud you.
    This seems like mission impossible, so if anyone can help in any way, I would be really grateful. 
    Thanks in advance for your time and thoughts!

    I meant to press on "This solved my question"... Sorry if you needed the points.
    Thank-you and I will just go back and forth between the accounts.

  • How can I share data between two forms on different lists

    Using a custom content type, I created two lists that I want to share the same data - one is a calendar.  Our employees complete a form from the "Out of Office Request" list that has workflow functionality that sends an email to that person's
    manager.  If the manager approves the request, the item automatically populates the "Out of Office Calendar."  The problem is that the only information from the request list that populates the calendar is the Title field and date/time fields. 
    I need the manager name in order to create a view for each manager.  
    How can I connect the other information in the request list to the calendar list.  It seems to me that if the title and date fields carry over the information, there should be a way to connect the other information.  I'm using Designer.
    I've tried to connect the two lists' webparts with the wizard, but when I get to the page that maps the two lists, there are no column names and the "Next >" button is grayed out.  This seems like the logical place to connect the two lists,
    but it isn't working.

    Hi,
    According to your post, my understanding is that you wanted share data between two forms on different lists.
    To show external  information on the calendar event, there are two methods: Calculated column, workflow. You can refer to:
    A Simple Guide to Show More Information on a Calendar Event
    I recommend to use workflow to achieve what you want. But you need to create a people column to display the manager.
    You can create a workflow associated to the "Out of Office Request" list, add action to Start Approve Process. If the manager approves the request, you can create a item in the calendar, and then update the people column and the title column.
    Then the calendar will display the Title, date/time and the manager.
    To create a view for each manager, you need to modify the Filter. You can use the people column is equal to the manager name or the Title contains the manager name.
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Use of SAP memory to transfer data between two different sessions.

    Hello experts,
    I wish to know how to use SAP memory to transfer data between two different sessions.
    The scenario is that when I run a report and change a variable, the value of changed variable should be availabe to another user on another terminal.
    Thanks & Regards!
    Sumit

    Hello,
    Just to add what Max has already mentioned. IMPORT TO / EXPORT FROM DATABASE statements can be used to store data in special "cluster" tables (you can't use any DDIC table) e.g., INDX.
    @OP: You can opt for Shared Memory(SHM) for this specific requirement as well. In my opinion SHM is a bit tricky to code, but it is easier to monitor. The opposite holds true for "data clusters".
    You should remember SHM is app-server specific. So if you've a load balancing scenario, using SHM can cause problems.
    Hope i'm clear.
    BR,
    Suhas
    Edited by: Suhas Saha on Nov 19, 2010 4:12 PM

  • How can I copy large amount of data between two HD ?

    Hello !
    Which command could I user to copy large amount of data between two hard disk drives ?
    How Lion identify the disk drives when you want to write some script, for example in Windows I sue
    Robocopy D:\folder source\Files E:\folder destination
    I just want to copy files and if the files/folders exist in destination the files should be overwritted.
    Help please, I bougth my first MAC 4 days ago.
    Thanks !

    Select the files/folders on one HD and drag & drop onto the other HD. The copied ones will overwrite anything with the same names.
    Since you're a newcomer to the Mac, see these:
    Switching from Windows to Mac OS X,
    Basic Tutorials on using a Mac,
    Mac 101: Mac Essentials,
    Mac OS X keyboard shortcuts,
    Anatomy of a Mac,
    MacTips,
    Switching to Mac Superguide, and
    Switching to the Mac: The Missing Manual,
    Snow Leopard Edition.&
    Additionally, *Texas Mac Man* recommends:
    Quick Assist,
    Welcome to the Switch To A Mac Guides,
    Take Control E-books, and
    A guide for switching to a Mac.

Maybe you are looking for