How to copy a table with LONG and CLOB datatype over a dblink?

Hi All,
I need to copy a table from an external database into a local one. Note that this table has both LONG and CLOB datatypes included.
I have taken 2 approaches to do this:
1. Use the CREATE TABLE AS....
SQL> create table XXXX_TEST as select * from XXXX_INDV_DOCS@ext_db;
create table XXXX_TEST as select * from XXXX_INDV_DOCS@ext_db
ERROR at line 1:
ORA-00997: illegal use of LONG datatype
2. After reading some threads I tried to use the COPY command:
SQL> COPY FROM xxxx/pass@ext_db TO xxxx/pass@target_db REPLACE XXXX_INDV_DOCS USING SELECT * FROM XXXX_INDV_DOCS;
Array fetch/bind size is 15. (arraysize is 15)
Will commit when done. (copycommit is 0)
Maximum long size is 80. (long is 80)
CPY-0012: Datatype cannot be copied
If my understanding is correct the 1st statement fails because there is a LONG datatype in XXXX_INDV_DOCS table and 2nd one fails because there is a CLOB datatype.
Is there a way to copy the entire table (all columns including both LONG and CLOB) over a dblink?
Would greatelly appriciate any workaround or ideas!
Regards,
Pawel.

Hi Nicolas,
There is a reason I am not using export/import:
- I would like to have a one-script solution for this problem (meaning execute one script on one machine)
- I am not able to make an SSH connection from the target DB to the local one (although the otherway it works fine) which means I cannot copy the dump file from target server to local one.
- with export/import I need to have an SSH connection on the target DB in order to issue the exp command...
Therefore, I am looking for a solution (or a workaround) which will work over a DBLINK.
Regards,
Pawel.

Similar Messages

  • How to Create a Table with Merge and partitions in HANA

    Hi,
    What is the best way to create a Table with MERGE and PARTITION and UNLOAD PRIORITIES.
    Any body can you please give me some examples.
    Regards,
    Deva

    Ok,
    1) the UNLOAD PRIORITY has nothing to do with the order of data loads in your ETL process
    2) Unloading of columns will happen automatically. Don't specify anything specific for the tables, then SAP HANA will take care about it
    3) Not sure where you get your ideas from, but there is no need to manually "flush" tables or anything like that. SAP HANA will take care of memory housekeeping.
    4) Partitioning and how to specify it for tables has been largely documented. Just read up on it.
    5) Delta Merge will happen automatically, as long as you don't prevent it (e.g. by trying to outsmart the mergedog rules)
    Seriously, I get the impressions that this list of requirements is based on some hear-say and lack of actual information and experience with SAP HANA. There are a couple of extensive discussions on data loading optimization available here in SCN and on SAPHANA.COM. Please read those first.
    All this had been discussed broadly a couple of times.
    - Lars

  • Copy a table with long data

    I have a table in which one column is long. The table also contains some record.
    How can I make another exactly same as this one (same structure/data)??

    hagrid wrote:
    I have a table in which one column is long. The table also contains some record.
    How can I make another exactly same as this one (same structure/data)??
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> help copy
    COPY
    Copies data from a query to a table in the same or another
    database. COPY supports CHAR, DATE, LONG, NUMBER and VARCHAR2.
    COPY {FROM database | TO database | FROM database TO database}
                {APPEND|CREATE|INSERT|REPLACE} destination_table
                [(column, column, column, ...)] USING query
    where database has the following syntax:
         username[/password]@connect_identifierLONG datatype has been deprecated for at least a decade.
    STOP using it it NOW!

  • How to display a table with rows and columns?

    Hi All,
    I am new to IPhone development,
    In my app user has to pick date from control, I had used UIDatePicker but user cannot pick year from that. so I wanted to write my own calendar view i.e A table with 6x7 cells using UITable.
    code snippet or any information on this will be appreciated.
    Thanks,
    Vashek

    I don't believe that the UITable on the iPhone supports mutiple columns. It is just a list of table cells. Each cell can have its own subset of controls (views) and I suppose this may be one way to give you what you want. But it seems like it would almost be better just to make your own table -- a view that contains the grid of subviews -- and lay that out in the parent view.
    I haven't had any experience with the UIDatePicker yet, though I can see it doesn't support year ... Why not build your own custom picker? It seems that would be a lot less hassle, and maybe more intuitive for the user, than building a full calendar view, especially if what you wanted initially was a picker anyway.
    Edit: I feel bad ... I didn't read through all the modes of UIDatePicker -- it does have a mode that supports year (UIDatePickerModeDate).
    Kevin
    Message was edited by: JediRunner

  • Problem with Long and BigDecimal DataType convertion

    HI,
    I have an application which talk to MySQL database with Spring JDBC layer and everything runs like a champ :)
    Now I am converting the same application with the same DAO implementation to communicate with oracle database and I am having some trouble converting DataType from database to my java code.
    For example before with MySQL I would convert any Integer coming from the database to Long datatype and it worked. Now it seems that Int datatype from oracle comes as a BigDecimal type.
    I am thinking about two approaches writing an additional implementation to implement my dao interfaces or if there is some trickery that I can bypass doing that and work around these datatype incompatibility from MYSQL to Oracle.
    I can also put bunch of try and catch statements and if fails with Long try with BigDecimal, but still don't buy it as the best solution.
    Here use also code snippet:
    User u = new User();
                        u.setObjectId((Long) m.get("oid"));//This works with MYSQL backend but not with Oracle so the raw object seem to be coming as BigDecimal datatype
                        u.setLogon((String) m.get("logon"));
                        u.setPassword((String) m.get("password"));
                        u.setName((String) m.get("uname"));
                        u.setCompany(companyDAO.getById((Long) m.get("cOid")));Any help will be appreciated.
    Edited by: kminev on Mar 3, 2010 12:25 PM

    //This is my entity class
    public class User implements Comparable<User>  {
        private Long objectId = 0L;
        private Company company;
        private String logon = "";
        private String password = "";
        private String name = "";
        private boolean hasAdminRights=false;
        private boolean hasMaintenanceRights=false;
    //This is my bean class
    <bean id="userDAO" class=" com.myorg.myapp.dao.jdbc.UserImpl">
            <property name="transactionManager">
                <ref local="transactionManager"/>
            </property>
            <property name="companyDAO">
                <ref local="companyDAO"/>
            </property>
            <property name="companyAccessDAO">
                <ref local="companyAccessDAO"/>
            </property>
        </bean>

  • Long and  clob datatype

    Hello Gurus
    we are working on oracle 8.1.4.0.in our database i have a table that contain a long column and a clob cloumn. i need backup of this table so that i can create the same table with data in other schema. Is there any recommmanded way. Can use copy or i need to use an export backup .
    thanks

    If possible, try to upgrade your long columns to lob. Working with long columns will severely limit the possibilities of adopting new features. It would have been easier to use the
    ALTER TABLE MOVE ... command.
    ~ Madrid
    http://hrivera99.blogspot.com/

  • How to Copy Excel table into CS4 and print onto photo in sequence.

    I would like to be able to import fields from Excel into Photoshop CS4 and have the Excel information print directly onto the photo image as a line of text across the bottom and layered over the image itself.  This Excel information needs to be able to change sequentialy (eg: ascending numbers, etc)  with each new photo.  Is there a way to do that with CS4 (or do I need a later version of Photoshop) ?

    Hi,
    I'm not sure, but your best bet would be ask over in the photoshop scripting forum.
    http://forums.adobe.com/community/photoshop/photoshop_scripting?view=discussions
    It's possible the variables feature in photoshop cs4 could do something like that:
    http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-7417a.h tml

  • ORA-12815 while reorg/compression of tables without LONG and LOB with 11g

    Hello fellows,
    I am in the luxury situation that I got a copy of our production R/3 environment that was left over from a project and is no more required by any of our developers.
    As we are still on oracle 9.2.0.7 I upgraded this copy to 11.2 in a two step process (from 9i to 10g to 11g).
    I got myself the SAP dbatools 7.20(3) and the Note 1431296 - LOB conversion and table compression with BRSPACE 7.20.
    I started with some small tablespaces but after a while I thought I'd like to try to reorg/compress the worst of all tablespaces...PSAPPOOLD with ~15.000 tables.
    I first converted tables with LONG fields online that can be compressed, than the onse that can not be compressed, than I reorged the tables that contain old LOB fields online. With these different executions of the brspace commands that are also mentioned in the above note I managed to move ~ 3.000 tables without any issues.
    But now I started with the biggest bunch of tables, the compression of tables without LONG and LOB fields online.
    This is the command I used:
    brspace -u / -p reorgEXCL.tab -f tbreorg -a reorg -o sapr3 -s PSAPPOOLD -t allsel -n psapreorg -i psapreorgi -c ctab -SCT
    ...after a few checks that are performed by brspace, I end up in the screen
    Options for reorganization of tables (which is still nothing I wouldn't have expected)
    1 * Reorganization action (action) ............ [reorg]
    2 - Reorganization mode (mode) ................ [online]
    3 - Create DDL statements (ddl) ............... [yes]
    4 ~ New destination tablespace (newts) ........ [PSAPREORG]
    5 ~ Separate index tablespace (indts) ......... [PSAPREORGI]
    6 - Parallel threads (parallel) ............... [1]
    7 ~ Table/index parallel degree (degree) ...... []
    8 ~ Category of initial extent size (initial) . []
    9 ~ Sort by fields of index (sortind) ......... []
    10 # Index for IOT conversion (iotind) ......... [FIRST]
    11 - Compression action (compress) ............. [none]
    12 # LOB compression degree (lobcompr) ......... [medium]
    13 # Index compression method (indcompr) ....... [ora_proc]
    But independent of what I enter in point 6 and 7, I always end up with below erros during the reorg/compression of the outstanding tables:
    Just one sample, but the issue is always the same.
    BR0301E SQL error -12815 in thread 2 at location tab_onl_reorg-26, SQL statement:
    'CREATE UNIQUE INDEX "SAPR3"."RTXTF_____0#$" ON "SAPR3"."RTXTF#$" ("MANDT", "APPLCLASS", "TEXT_NAME", "TEXT_TYPE", "FROM_LINE",
    "FROM_POS")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 1662976 NEXT 655360 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "PSAPREORGI" PARALLEL ( INSTANCES 0) '
    ORA-12815: value for INSTANCES must be greater than 0
    Just in case, here it the OBJECT DDL:
    CREATE UNIQUE INDEX "SAPR3"."RTXTF_____0"
        ON "SAPR3"."RTXTF"  ("MANDT", "APPLCLASS", "TEXT_NAME",
        "TEXT_TYPE", "FROM_LINE", "FROM_POS")
        TABLESPACE "PSAPPOOLI" PCTFREE 10 INITRANS 2 MAXTRANS 255
        STORAGE ( INITIAL 1624K NEXT 640K MINEXTENTS 1 MAXEXTENTS
        2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1)
        LOGGING
    Perhaps someone already gained some experience on the compression with brspace and can give me a hint.
    Many thanks
    Florian

    Hello Florian,
    > Perhaps someone already gained some experience on the compression with brspace and can give me a hint.
    I have not performed any compression operations on Oracle 11g R2 with brspace until yet .. but this error seems to be very obvious.
    It seems like SAP is still not using the procedure DBMS_REDEFINITION.COPY_TABLE_DEPENDENT to create the indexes (and NOT NULL constraints) on Oracle 11g R2. No idea why, i can only think of one case (create a DDL file before reorganisation to change the DDL parameters through the reorganisation in some kind of ways).
    So in your case it seems like SAP is creating a wrong SQL for creating the index on the interim table.
    You can try to create the DDL file first and correct the parameters and after that you can try to run the reorganisation again.
    Please check sapnote #646681 (Remark 5) for more information about the procedure for "creating the DDL first .. and then do the reorg with edited parameters).
    Regards
    Stefan

  • How to create a table with datatype blob and insert a pdf file (ravi)

    how to create a table with datatype blob and insert a pdf file,
    give me the explain asap
    1.create the table?
    2.insert the pdffiles into tables?
    3.how to view the files?
    Thanks & Regards
    ravikumar.k
    Edited by: 895044 on Dec 5, 2011 2:55 AM

    895044 wrote:
    how to create a table with datatype blob and insert a pdf file,
    give me the explain asapPerhaps you should read...
    {message:id=9360002}
    especially point 2.
    We're not just sitting here waiting to answer your question as quickly as possible for you.

  • I have a problem with mail.  the spelling and grammer check box before sending the messege is no longer there.  I did everything but cannot get it back.  is ther anyone who knows how to get the box with spelling and grammer checks before sending

    i have a problem with mail.  the spelling and grammer check box before sending the messege is no longer there.  I did everything but cannot get it back.  is ther anyone who knows how to get the box with spelling and grammer checks before sending the mail.
    Also the mail is acting very funny by not getting the rules work in a proper method.  Is ther a software to repair mail.

    i did both of them, but still the while sending the mail the diolog box is not showing up and also the spelling and grammer does not do the spelling check. 
    This problem just started for about 3 to 4 days now.  earlier it was working normally.

  • How to create table with rows and columns in the layout mode?

    One of my friends advised me to develop my whole site on the
    layout mode as its better than the standard as he says
    but I couldnot make an ordinary table with rows and columns
    in th layout mode
    is there any one who can tell me how to?
    thanx alot

    Your friend is obviously not a reliable source of HTML
    information.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Mr.Ghost" <[email protected]> wrote in
    message
    news:f060vi$npp$[email protected]..
    > One of my friends advised me to develop my whole site on
    the layout mode
    > as its
    > better than the standard as he says
    > but I couldnot make an ordinary table with rows and
    columns in th layout
    > mode
    > is there any one who can tell me how to?
    > thanx alot
    >

  • How to find index name with primarykey and column on a table?

    Hi,
    how to find index name with primarykey and column on a table?
    please help me.
    Thankyou.

      1  select ac.table_name, ac.index_name, aic.column_name
      2  from user_constraints ac, user_ind_columns aic
      3  where ac.constraint_type = 'P'
      4   and  ac.index_name = aic.index_name
      5* order by 1,2,3
    SQL> /
    TABLE_NAME                 INDEX_NAME                COLUMN_NAME
    ACTION_TABLE                 SYS_C0011033                NESTED_TABLE_ID
    ACTION_TABLE                 SYS_C0011033                SYS_NC_ARRAY_INDEX$
    CATEGORIES_TAB                 SYS_C0011038                CATEGORY_ID
    CUSTOMERS                 CUSTOMERS_PK                CUSTOMER_ID
    INVENTORIES                 INVENTORY_IX                PRODUCT_ID
    INVENTORIES                 INVENTORY_IX                WAREHOUSE_ID
    LINEITEM_TABLE                 SYS_C0011034                NESTED_TABLE_ID
    LINEITEM_TABLE                 SYS_C0011034                SYS_NC_ARRAY_INDEX$
    ORDERS                      ORDER_PK                 ORDER_ID
    ORDER_ITEMS                 ORDER_ITEMS_PK                LINE_ITEM_ID
    ORDER_ITEMS                 ORDER_ITEMS_PK                ORDER_ID
    PRODUCT_DESCRIPTIONS            PRD_DESC_PK                LANGUAGE_ID
    PRODUCT_DESCRIPTIONS            PRD_DESC_PK                PRODUCT_ID
    PRODUCT_INFORMATION            PRODUCT_INFORMATION_PK           PRODUCT_ID
    PROMOTIONS                 PROMO_ID_PK                PROMO_ID
    WAREHOUSES                 WAREHOUSES_PK                WAREHOUSE_ID
    16 rows selected.

  • How to copy the photo with file name at window 7 and search specific one in iphone 4s?

    How to copy the photo with file name at window 7 and search specific one in iphone 4s?

    Clendenen02 wrote:
    2) It would be equally helpful if there was something that would take the name of the picture file and spotlight comment, copy and paste it to a movie file's comments with the same name but obviously has different extention. For an example
    In a Pictures folder
    Name: Dark Knight, The.jpeg       Comment: (2008) Genre: Action...             <- copy comment
    In a Movie Folder
    Name: Dark Knight, The.m4v       Comment:                                               <- paste 
    and do this for all 700 files
    This Bash script will do it.
    Edit "PicDir" and "MovDir" to the location of your Folders
    (Note: The comment is written to the m4v file using xattr, so the Spotlight comment field appears blank in Finder, but the comment metadata is still indexed by Spotlight (If you add a Spotlight comment from Finder, it is stored both as an extended attribute and in a .DS_Store file)
    #!/bin/bash
    PicDir=$HOME/Desktop/Pictures
    MovDir=$HOME/Desktop/Movies
    for f in $PicDir/*
    do
         if [ ! -d "$f" -a "${f##*.}" == "jpeg" ]; then
              comment=$(mdls -raw -name kMDItemFinderComment "$f")
              if [[ $comment != "(null)" ]]; then
                   picname=${f##*/}
                   movname=${picname%.*}.m4v
                   if [ -e "$MovDir"/$movname ]; then
                         xattr -w com.apple.metadata:kMDItemFinderComment "\"$comment\"" "$MovDir"/$movname
                   fi
              fi
         fi
    done

  • Moving a table with long data type column

    hi
    1.how to move a table with a long data type column in 8.1.7.3.0 ver database.
    alter table APPLSYS.FND_LOBS_DOCUMENT move lob(BLOB_CONTENT) store as (tablespace testing)
    ERROR at line 1:
    ORA-00997: illegal use of LONG datatype
    2. and a table with varray type column
    alter table APPLSYS.WF_ERROR move lob("USER_DATA"."PARAMETER_LIST") store as (tablespace testing)
    ERROR at line 1:
    ORA-22917: use VARRAY to define the storage clause for this column or attribute
    table description is:
    SQL> desc applsys.wf_error;
    Name Null? Type
    Q_NAME VARCHAR2(30)
    MSGID NOT NULL RAW(16)
    CORRID VARCHAR2(128)
    PRIORITY NUMBER
    STATE NUMBER
    DELAY DATE
    EXPIRATION NUMBER
    TIME_MANAGER_INFO DATE
    LOCAL_ORDER_NO NUMBER
    CHAIN_NO NUMBER
    CSCN NUMBER
    DSCN NUMBER
    ENQ_TIME DATE
    ENQ_UID NUMBER
    ENQ_TID VARCHAR2(30)
    DEQ_TIME DATE
    DEQ_UID NUMBER
    DEQ_TID VARCHAR2(30)
    RETRY_COUNT NUMBER
    EXCEPTION_QSCHEMA VARCHAR2(30)
    EXCEPTION_QUEUE VARCHAR2(30)
    STEP_NO NUMBER
    RECIPIENT_KEY NUMBER
    DEQUEUE_MSGID RAW(16)
    SENDER_NAME VARCHAR2(30)
    SENDER_ADDRESS VARCHAR2(1024)
    SENDER_PROTOCOL NUMBER
    USER_DATA APPS.WF_EVENT_T
    lob column:
    SQL> select owner,table_name,column_name from dba_lobs where table_name='WF_ERROR';
    OWNER TABLE_NAME COLUMN_NAME
    APPLSYS WF_ERROR "USER_DATA"."PARAMETER_LIST"
    APPLSYS WF_ERROR "USER_DATA"."EVENT_DATA"
    pls help me
    thanks and regards
    srinivas

    1. Export and import
    2. Sql*Plus 'copy' command
    It is a good idea to move from 'LONG' to 'CLOB'.

  • Simple: How to copy a Table from one Database to another?

    I already know how to do it by creating an identical table and then inserting the Data.
    Like so:
    SET IDENTITY_INSERT dByDtMinusC5 ON
    INSERT INTO [DB1]..T1 ([Id], [HbyD] , [K] )
    SELECT [Id], [[HbyD]]] ,[K] FROM [DB2]..T2
    As you can see I need to have T1 in order to copy T2 into DB1. Is there any way that I could auto create T1 and copy T2?
    There are so many forums in sql server Category, I hope I posted in the right one :0 . We need tag system for forums.   

    Hi Bhupinder,
    According to your description, you want to copy a table with Primary keys from one database to another database.
    As per my understanding, I think the best method is use Transfer SQL Server Objects Task in SQL Server Integration Services. The Transfer SQL Server Objects task transfers one or more types of objects in a SQL Server database between instances of SQL Server.
    Server roles, roles, and users from the specified database can be copied, as well as the permissions for the transferred objects. Indexes, Triggers, Full-text indexes, Primary keys, Foreign keys can also be copied.
    To use the Transfer SQL Server Objects Task, we should create a SQL Server Integration Services Project in SQL Server Data Tools, then drag a Transfer SQL Server Objects Task to Control Flow pane. Specify SourceConnection, SourceDatabase, DestinationConnection
    and DestinationDatabase for the Connection, select the table in the ObjectsToCopy category, then change CopyPrimaryKeys to True and the other corresponding properties in the task.
    References:
    Transfer SQL Server Objects Task
    Transfer SQL Server Objects Task in SSIS 2008 R2 With Example
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for

  • When viewing a note in the bridge how do you switch to landscape full screen mode?

    When viewing notes in the Bridge, there are two modes after pressing messages.  One is portrait where the note being viewed shows in full screen after going to it from the inbox list.  The other is in landscape where the inbox list is on the left and

  • L&F error when starting application on Mac OS 10.3.5

    I'm trying to execute a Java application I'm developing on Mac OS 10.3.5. But I keep getting this error: Richard@cthulu( 18 )$ ant java.alone Buildfile: build.xml (... snip ...) java.alone: [java] java.lang.Error: can't load apple.laf.AquaLookAndFeel

  • Apps no longer syncing to ipod - help?

    I've moved to the latest software and am using the new itunes, and my apps have disappeared from my ipod and won't sync.  I've got the settings to back up to "this computer."  On the apps tab, it shows "0" but they're all listed on that page.  By dra

  • Customer creation in R/3 from PI data using IDOCs

    Hi All, I am creating customers in SAP r/3 system using IDOCs which are coming from PI system in the form of XML files. For that DEBMAS and ADRMAS message types and DEBM process code is used for creating or changing customer master data. Existing fun

  • Mac Finder previews for .AI files not working

    [I'm using fully updated OS X 10.8.5, using Illustrator CS6 16.0.4] In the Finder, all my .AI files show up only as a generic AI file icon. Trying to Preview the files in the Finder also only show the generic icon. I've tracked down the QuickLook Gen