Oracle Copy command

Hi,
I was hoping someone might be able to help me out with a question/issue I have when using the copy command in SQLPlus. The scenario entails moving specific columns from a table in DB A to a new table in DB B (DB B is on a completely different server). When I use the copy from to create select command I am finding that the column sizes are being increased by a factor of 4. So in my source table I have a column which is VARCHAR2(15 CHAR), yet after the copy command is complete the target table has the same column as VARCHAR2(60 CHAR).
Does anyone know how I can get copy to keep the column sizes the same? i.e. VARCHAR2(15 CHAR) in source, VARCHAR2(15 CHAR) at target.
I have tried pre-creating the tables which the correct sizes and then using insert in the copy command, however it errors out when it thinks the size has been exceeded.
Thanks in advance

Hope this pastes ok:
Target System:
desc s_addr_per
Name Null Type
ROW_ID NOT NULL VARCHAR2(60 CHAR)
CREATED NOT NULL DATE
CREATED_BY NOT NULL VARCHAR2(60 CHAR)
LAST_UPD NOT NULL DATE
Source System:
desc siebel.s_addr_per
Name Null Type
ROW_ID NOT NULL VARCHAR2(15 CHAR)
CREATED NOT NULL DATE
CREATED_BY NOT NULL VARCHAR2(15 CHAR)
LAST_UPD NOT NULL DATE
Note : this is a only the first couple of columns in the table

Similar Messages

  • Dabase link while using copy command in Oracle 9i

    Hi,
    Is it must to have a database link while copying data between two databases in Oracle 9i using COPY command?
    I am using the copy command like following:
    SQL> copy from xxx/xxx@xyz to abc/abc@stu insert Table using select * from Table
    Database link is always required in Oracle 9i to copy data ?
    rgds,
    Karna

    When you use the copy command, all you need is that both databases are in the tnsnames.ora file and you can commect using the username/password#sid string. The copy command doesn't use the DBlink.

  • Copy command in oracle

    hi how i can do this following in copy command-------------
    t1 t2
    id1 val1 id1 val1
    copy from user1/pass1@db1 to user2/pass2@db2 insert t2 using select *from t1
    now in my case i have some data in t2 in such a way that id1(tab2) and id1(tab1) are same but their value(here val1(tab2) and val1(tab1)) are different.
    as id1 is primary key in tab2 i cannot insert this matched values.
    now i want to do this checking in the copy command where tab1.id1<>tab2.id1

    hi
    Create DB link like
    CREATE DATABASE LINK local
    CONNECT TO hr IDENTIFIED BY hr
    USING 'local';
    Try to access or insert the rows in the remote table by using the following command
    insert into tab1 SELECT * FROM tab1@local where pkid not in ( select pkid from tab1);
    Regards
    Singh

  • Copy Command in Pl/Sql block

    Can I use Copy command in Pl/Sql.For example :-
    Declare
    cursor c1 is select table_name from all_tables
    where owner = 'LSP' and rownum = 1;
    v1 varchar2(2000);
    Begin
    for c2 in c1 loop
    v1:='copy from lsp/lsp123479@dvlaq to scott/[email protected] create '|| c2.table_name ||' using select * from '||c2.table_name;
    execute immediate v1;
    end loop;
    end;
    Its not running properly giving an error as invalid Sql statement .
    Is it bcoz Copy command cannot be used in a Pl/Sql Block.

    Is there any other way to move the Table & data to another Data Base .Database link is the obvious one. And the SQL statement would look something like this (on the target database):
    SQL> create table FOO nologging as select * from FOO@sourcedb;
    However, the first question I always ask if why? What one may think is the solution to a problem is not always the best solution. So one need to identify the problem first, and then see what solutions there are and which one is the best fit.
    Other options are replication (using materialised views for example), Data Pump (available with 10G) - even could be Data Guard, a standby database, or a Real Application Cluster... depending on just what the problem and actual requirements are.
    Also important to note that SQL*Plus has its own set of commands. Do not confuse these commands (like EXEC, COPY, CONNECT, HOST etc) with the SQL and PL/SQL Languages. Not only are they executed by different software products, SQL*Plus commands are executed on the client and SQL (and PL/SQL) runs inside the Oracle database instance.

  • Copy command in Sqlplus

    I am using 8.1.6 and 8.1.7, but the copy command does not seem to work on either cases, the sqlplus just crash, did you guys have the similar problem? Is it a bug in oracle or there is some parameter I need to set up correctly?
    Your help is highly appreciated.

    it works i tried
    null

  • COPY command in SQL*Plus 8.1.6 returns ORA-65535

    The COPY command in the windows version of SqlPlus (SQLPLUSW) does not work any more. I get the following error
    << Array fetch/bind size is 5. (arraysize is 5)
    Will commit after every array bind. (copycommit is 1)
    Maximum long size is 80. (long is 80)
    ERROR:
    ORA-65535: Message 65535 not found; product=RDBMS; facility=ORA >>
    Interestingly, I can run the same COPY command successfully if I use SQLPLUS.exe ( the command line version ). No error & it completes the copy.
    I recently changed my Oracle client from 7.3 to v8.1.6.
    I had not encountered this problem with the same command in v7.3.

    You may have run into bug 1504702. As a workaround you will need to use command line, as you've already figured out. I don't think a patch is available for Windows yet, although there is for Solaris (in the 8.1.7.4 patch set).
    Alison

  • SQL*Plus 'Copy' command and LONG datatypes

    Hi. I'm using Oracle 9.2.0.5 and wanna copy LONG to LONG without using an Interface in VB or any other programming language.
    Some of the fields (plain text) are greater than 32 Kb, and I tried the SQL*Plus 'Copy' command, without success.
    (For compatibility reasons I can't convert LONG to CLOB, I need to copy LONG to LONG)
    This is the example I'm working with:
    Table Source_LONG (ID number, DATA long)
    Table Destination_LONG (ID number, DATA long)
    The SQL*Plus command: (connected from test_database@environment)
    set long 100000
    copy from test_database/test_database@environment insert destination_long (id,data)
    I tried using both FROM and TO, but same results.
    The fields are copied into destination_long, but they are
    truncated at 32768 bytes, even with the LONG variable set to 100000. Any ideas ?
    Thanks.

    I'm working with 2 similar tables with this structure:
    SOURCE_LONG (ID number, DATA long)
    DESTINATION_LONG (ID number, DATA long)
    SOURCE_LONG contains two rows:
    ID DATA
    1 hello
    3 ....text bigger than 32kb...
    I tried your solution and it insert 2 rows, but only the ID is filled. The DATA is empty in both cases :-(
    insert into destination_long(id,data) (select id,to_lob(data) from source_long);

  • Coppy commit while using copy command

    I am seeing the following message when I used Copy command in Oracle 9i.
    Array fetch/bind size is 15 (arraysize is 15)
    Will commit when done (coppycommit is 0)
    Maximum long size is 80 (long is 80)
    Could someone tell what does it mean and is there any harm with coppycommit being ZERO ? If so how we could change it ?
    DBA was telling the following:
    In using the copy command in oracle, not specifying 'arraysize' and 'copycommit' attributes for large records will blow up the rollback segment and return errors.
    thanks,
    Karna

    SQL> show copycommit
    copycommit 0
    SQL>
    SQL> set copycommit 5000
    SQL>
    SQL> show copycommit
    copycommit 5000
    SQL>
    SQL> show arraysize
    arraysize 15
    SQL>
    SQL> set arraysize 100
    SQL>
    SQL> show arraysize
    arraysize 100
    SQL>
    SQL> show long
    long 80
    SQL>
    SQL> set long 40000
    SQL>
    SQL> show long
    long 40000
    SQL>You rollback size must be in suitably sized for the type of work you are doing. A commit in batches may or may not avoid blowing the rollback segments. A commit in batches does not gurantee not to blowup the RBS.

  • Copy command looses default values

    Hi,
    I have got a problem with the COPY command. I just want to copy the data in a very fast way to copy from one remote database to another one. I suggested that it would be the fastest way to use the copy command.
    insert into (select * from dblink) has been to slow
    The problem is that the copy command with REPLACE replaces the table, drops the indexes, trigger AND the default values!!!!!!
    Is there a possibility to solve this problem? Or is there another way to load the data in a very, very fast way?
    Thank you very much
    Henrik Rünger
    Consultant | OCP
    ckc ag | www.ckc.de

    It sounds like the destination table already exists. What about doing
    a DELETE to clean up the destination table and then using COPY INSERT?
    COPY may or may not be fast depending on a range of things. With
    COPY, all the data gets moved across the network from the source DB to
    SQL*Plus and then across the network again to the destination DB.
    What about export/import or the new 10g "datapump"? See
    http://otn.oracle.com/obe/obe10gdb/integrate/datapump/datapump.htm
    -- CJ

  • COPY command replacement

    Given that the COPY command is now deprecated (and clearly documented in 10gR2 - sqlplus user's guide that it will be obsoleted in future releases of SQL*Plus, will there be any replacement command in sqlplus?
    We were planning to use it to implement for our simulation model - but given it is deprecated and does not support new data types, we are forced to look for alternatives. What are the alternatives for a local area network or copying data between two oracle accounts using different tablespaces on the same db server?
    Pro*C/Direct Path Load,
    expdp/impdp,
    copy over dblink and then recreate the constraints and indexes,
    which one will be faster, should be used based on the following?
    What we want to do is to checkpoint (save) historical game data, and if required/necessary, be able to bring back the data from a saved game checkpoint X, where X can be any number (checkpoint 4 or 20, etc). We also want to hold onto the saved game checkpoint files so that we can take it to another place for after action review purposes.
    Any input is appreciated.
    regards.

    copying data between two oracle accounts using different tablespaces on the same db server?For this I would grant SELECT on the table to be copied to the target Oracle account and use CREATE TABLE ... AS SELECT ... and recreate constraints and indexes.

  • "Copy Command Desupport"

    Heard that "Copy Command will be obsolete in coming Oracle versions . Any idea , quick answers will be really appriciated.

    Contradiction over COPY command
    A. Release Note 9.2.0.2
    April 2002
    Part No. A96545-01
    7.1 COPY Command
    COPY supports the datatypes listed for the COPY command in the SQL*Plus User's Guide and Reference, but no new datatypes will be supported. The COPY command may be obsoleted in a future release of SQL*Plus.
    B. SQL*Plus® User's Guide and Reference Release 10.1
    Part Number B12170-01
    Copy command is still there is 10g SQL Plus.
    refer >> http://download-west.oracle.com/docs/cd/B12037_01/server.101/b12170/apb.htm

  • Copy command of SQLPLUS is failing

    Oracle Version 8i.
    When trying to use the copy command -in SQLPLUS- to copy the data from one database to the other, I am encountering the following error.
    Error: SP2-0027: Input is too long (> 2499 characters) - line ignored
    Reason for using the copy command is: Allows me to set commit points as against Insert into ... select * from command.
    The table, I am copying has lot of columns and the number of characters in the script are more than 3000.
    Where is the restriction of 2499 characters set? Is there a way to alter this?
    Thanks
    null

    You can export the table(s) and import into your database.

  • Copy command for SQL*Plus

    Am trying to use the copy command in SQL*Plus to copy a table
    from an Oracle database to a local table on my machine in
    another format. Keep getting errors. It seems to contact the
    remote machine fine, but can't locate my local machine or figure
    out where to put it. Any suggestions on how to set up my
    Windows 95 machine to get the copy command working would be
    greatly appreciated. Thank you.
    null

    Hi,
    Here is an example :
    SQL> copy from scott/tiger@q4_production_server create ord -
    using select * from ord;Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
    Table ORD created.
    21 rows selected from scott@q4_production_server.
    21 rows inserted into ORD.
    21 rows committed into ORD at DEFAULT HOST connection.
    Hope this helps,
    Bala
    Laura Michaels (guest) wrote:
    : Am trying to use the copy command in SQL*Plus to copy a table
    : from an Oracle database to a local table on my machine in
    : another format. Keep getting errors. It seems to contact the
    : remote machine fine, but can't locate my local machine or
    figure
    : out where to put it. Any suggestions on how to set up my
    : Windows 95 machine to get the copy command working would be
    : greatly appreciated. Thank you.
    null

  • COPY command with Transparent Gateway

    We have tried to use copy command to copy the data from AS/400 database (tns name as AS400) to Oracle database (Data2) in NT thru Transparent Gateway. The following works using INSERT statement:-
    INSERT INTO EMP select * from scott.emp@as400
    But when we use COPY command it returns:
    COPY FROM scott/tiger@as400
    INSERT EMP
    USING select * from scott.emp@as400
    Error:ORA-03113 end-of-file on communication channel.
    When we use the copy command to copy from Oracle back to AS400 to Transparent Gateway. It does not work and return
    "Oracle SQL*Plus:SQLPLUSW.exe - Application Error The instruction at "0x63223160" referenced memory at "0x77f64e1f" The memory could not be written"
    null

    Other than those problems, do you really want to use COPY? It takes the data on a network trip to SQL*Plus and then to the destination server. Maybe CREATE AS SELECT will be more efficient.
    - CJ

  • SQLPLUS COPY COMMAND and TIMESTAMPS

    I am copying data from production to a database warehouse. We had used insert into at one point but switched to the SQLPLUS COPY command as it increased our performance by almost over 50%. We recently added a table that has a TIMESTAMP. I understand this datatype isnt supported by COPY. Is there anything that I can use other than going back to the INSERT statement through a DB link?
    Thanks,
    Scott

    Hi,
    Just refer to Data Pump
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_overview.htm#sthref22

Maybe you are looking for

  • Restoring Aperture Library from Vault

    Hi all, I hope someone can help.  I recently had my 'Drobo' die on me as two discs failed at the same time.  I also have a copy of my Aperture Library backed up in a Vault.  I have carried out a 'Restore from Vault' and my new  external HD shows 1.5T

  • Flash doesn't work on IE 7

    When I go to http://www.macromedia.com/software/flash/about/ it says I have version 9,0,47,0 installed. Whenever I go to a site that uses Flash it says it's not installed. For instance, http://www.nmai.si.edu/education/codetalkers/ returns: "Native W

  • GTX 660 TF 2GD5 works in 8x bus interface instead of 16x

    Hallo, the issue that I'm having is that my GPU (MSI GTX 660) is reported to be working in x8 bus interface, not the x16. I have checked and the card is seated in the upper PCIE slot, which is supposed to be giving x16 interface, and I have no second

  • I have to give the technical names to abaper for following fields to be pri

    I have to give the technical names to abaper for following fields to be printed in the GRN print out what r the table & field names for following Buyer's name   Project Number / Cost Center   Suppliers Delivery Note Number   Quantity Remaining (per M

  • Alacarte won't start in Gnome 3.6.1

    Having some trouble starting alacarte in Gnome 3.6.1: [davidt@arch ~]$ alacarte Traceback (most recent call last): File "/usr/bin/alacarte", line 22, in <module> from Alacarte.MainWindow import MainWindow File "/usr/lib/python2.7/site-packages/Alacar