Copying a table from one databse to another

Hi,
I used the following code to copy a table from one database to another.
set copycommit 1
set arraysize 1000
copy from username/passwd@tnsname -
create <tablename> -
using -
select * from <tablename>
But I get the following error:
set copycommit 1
ERROR at line 1:
ORA-00922: missing or invalid option
Could you please let me know how this can be done.
Thanks,
Narasimhan

Thanks for your suggestions.I created a database link.I had no problems.
Then when i issue the command
copy from uname/password@db
create <tablename>
using
select * from <tablename>
<Here db is database link to source database identified by uname and password>.
I still get the error
copy from uname/password@db
ERROR at line 1:
ORA-00900: invalid SQL statement
Does it mean that the command is wrong?Or I'm doing something different.
Thanks!

Similar Messages

  • How to Move or Copy the Tables from One Database to Another Database ?

    HI,
          Can any one help me on this, How i can move or copy the tables from one database to another database in SQL server 2005 by using SQL query. Hope can anyone provide me the useful and valuable response.
    Thanks
    Gopi

    Hello,
    Maybe these links help you out
    http://www.microsoft.com/downloads/en/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en
    http://www.suite101.com/content/how-to-copy-a-sql-database-a193532
    Also, you can just detach the database make a copy and move it to the new server.

  • 10g express, scheduled copy of table from one db to another

    Hi,
    I don't know much about Oracle and was hoping if someone could shed some light on how we could implement our solution.
    Our scenario is as follows:
    For a new customer we are going to have 35million records per month coming into the database.
    What we had normally been doing in MSSQL, is creating a new table every month and writing the records in here (although we never had 35 million records before).
    The problem is, I want to archive these old monthly tables in order to save space. I don't know enough about the Oracle suite to see if there is already a program that we can schedule every month to move this table from one database to another. I was initially doing it by code, but this ends up taking 3 hours to copy... something we cannot afford.
    Is 35 million records too much to hold in a table? Should we be partitioning this down even more? I don't know where the threshold is before Oracle craps out.
    Or, maybe a better idea is to create a new database and just store new entries in a new database every month... this way we won't need to copy anything. To me, this sounds stupid though as i don't want to have 60 databases kicking around in five years.
    I'm a developer and no DBA, no one here is a DBA. We're trying to evaluate if our application is going to work on a Oracle platform all without knowing anything about it. Please help!
    Thanks,
    Kevin
    Message was edited by:
    user518940

    Kevin, you definately have the right database for 35M records/mth.
    From your post, it sounds like you need to retain the records in a database for 5 years (yes?). I don't know of any size limitation for Oracle outside of the OS. I don't think your solution should be multiple databases unless you have vastly different needs for the database that can not be satisfied with one instance - ie. OLTP vs. BATCH/OLAP...
    I don't fully understand what you are shooting for because it doesn't sound like you are going to save on any space just by moving the data from one database to another, the records will still require a similar amount of space unless compressed on another database. In either case, unless you can't, I would recommend a single database design. If you need high performance querying the data, and you query it by a specified period of time - ie month, I would recommend using enterprise edition with partitioning (seperately licensed). This would allow you to create a partitioned table where you could partition the table by month. As long as you don't create unnecessary global indexes, the performance should be quite similar to querying/inserting/appending into a table just containing 1 months records. Each partition can be placed in its own tablespace/datafile(s).
    If you absolutely must 'transport' the data to another instance (which I would strongly suggest that you should load it there in the first place unless business rules, performance limitations or something else simply don't allow it), you can use 'transportable tablespaces' and simply ftp the entire datafile to another Oracle database and attach it thus avoiding having to reload it. If it's truly historical you can just leave it ReadOnly. If you want to be tricky about it, you could try to make it part of a partitoned table on the new host.
    I hope I've helped just a little bit. If you need additional help, email me directly at LenLopez AT Yahoo DOT com

  • 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

  • How to copy a table from one system to another system

    Hi all,
            can any one say how to copy table from one system(sys1) to another system(sys2).
    regards,
    nagaraj

    There are many ways.
    1. Use the already existing transaport request number for that table to do the transaport (Active)
    2. Create mannual transport request from SE01 and in the object list enter following
    R3TR -- TABI -- <Table Name>
    And do the transaport.
    3. Ask your basis consultant to do the transaport from oracle layer.
    Thanks,

  • In PL-SQL copy a table from one database to another

    I am currently working on a VB app where I need a way to archive tables from the running database to an archive database. I was hoping to do this with a stored procedure. Thanks for any suggestions in advance.

    AFAIAA there is no equivalent of the SQL*Plus copy command, but it is realtively simple to build such a thing in PL/SQL using DBMS_SQL or EXECUTE IMMEDIATE to issue the necesssary INSERT INTO table@archive_db select * from table;It's simple to create the table in the archive db , you just test for it's exist using %SQLFOUND.
    If you want it fancier, eg. changing the tablename dynamically that's also easy.
    rgds, APC

  • How to copy system table from one client to another client

    Hi,
    Currently i am implementing recruitment module in one of the power sector company. I have finished all the configuration in one of the client in development server. I have trasported all the request in Qulaity server so that i can do the testing. When i am running TCode : PBA7 (Direct Data Transfer) i am getting a runtime error with error analysis -
    A SELECT, UPDATE, or DELETE statement contains the invalid table
    name "PB0021".
    I have checked this system table in this client (Quality Server) but this table is not available, but at the same time this table is available in Devepment server client where i can run this transaction.
    Requiring your help on this to resolve this issue. Do i need to copy this system table PB0021 from Development server client to Quality server client? If so then how to do this activity?
    Thanks in advance....
    Regards,
    Milind

    Hi Milind,
    Goto SE01.
    Create a workbench request manually.
    Add the following entry.
    R3TR TABL PB0021.
    Transport the request to quality system.
    Hope this works.
    Best wishes,
    Dilek

  • How to copy a physical Alias table from one rpd to another

    Hi
    I am copy pasting the physical tables from one rpd to another. I first copied the physical table and then tried to copy the alias table i get the message ' Unknown Error' when i click ok it says
    'Failed to copy from clip board"

    Identify the "class=MyStyle" string in the MTML code, and use the Multi-File Find and Replace feature to step through each topic and change the specific instances to "class=MyOtherStyle." (I doubt that you'll want to "Replace All".)
    Sorry, there's no silver bullet!
    Good luck,
    Leon

  • To copy table from one database to another

    hai,
    I will be really pleased if someone can me tell me that how can i copy table from one database to another. I am having two databases.
    Gursimran

    You can Also do
    ++ Create a database link on the TARGET to SOURCE
    CREATE PUBLIC DATABASE LINK <<DBLNK_NAME>> CONNECT TO <<USER>> IDENTIFIED BY <<PASSOWORD>> USING '<<TNS_NAME>>';
    ++ And copy as below
    CREATE TABLE EMP AS SELECT * FROM EMP@DBLNK_NAME;

  • How to copy a table from one text frame to another...

    Is there a way to copy a table from one text frame to another? I'm using JavaScript. The following will move a table from one text frame to another, but I need to copy.
    var srcFrame = document.textFrames.item("section-template");
    var dstFrame = document.textFrames.item("test");
    srcFrame.characters[0].move(LocationOptions.before, dstFrame.insertionPoints[0]);
    Thanks,
    Mike-

    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

  • How can I copy cell formatting from one range to another?

    How can I copy cell formatting from one range to another, including text fonts, colours, borders, etc., so that, for example, I can reuse a formatted reconciliation table again in different parts of a sheet?

    Hi George,
    Wayne found the Spinning Beachball of Death, and you will find it too.
    Numbers is not good at handling large datasets. Might I suggest that you group your data into smaller sets (each month, perhaps?) and save each group in a separate Numbers document. Numbers will not link between documents, but you could have a summary Table within each document. Then comes the "clunky" bit of copying all those summary tables into a master document where you do the final processing of the data.
    Regards,
    Ian.

  • Error while copying GL Accounts from One Client to another client

    Hi,
    We are trying to copy GL accounts created in one client to another client (Company Code is same in both the clients). First we executed FS15 (send) and a file was created on the server. With the help of BASIS team we checked that file and it contained the required values. However, when we are doing FS16 (receive) we are getting following OK messages:
    File /usr/sap/DEV/SYS/global/FBISABC is being checked
    Session 1 session name RFBISA20 : No terminations have been found
    However, at the same time we are getting following error message:
    File name FI_COPY_COMPANY_CODE_DATA_FOR_GENERAL_LEDGER_0X is unknown
    Message no. SG001
    Diagnosis
    No entry was found in the conversion table for the logical file name FI_COPY_COMPANY_CODE_DATA_FOR_GENERAL_LEDGER_0X.
    Procedure
    Add an entry to the conversion table for the logical file name. Maintain the conversion table with the transaction SM30.
    Can someone please advice is there something wrong that we are doing for copying GL accounts from one client to another client.
    Thanks,
    Sanjay

    Dear Sanjay,
    Did you check the batch-input? SM35
    It could have happend that there was a mistake in the batch-input data and that the destination file has not been written. If this has not been written it could not be found.  (I.E. you tried to transport G/L Accounts with deletion flags but did activate the checkbox "Transfer deletion ****").
    There is another point: Did you activate the box "Datei nur prüfen" (English: Check file only)? If this box is activated the programm will check if the batch-input-file will be written without mistakes but it will not write the file. Only if the checkbox is not activated the batch-input-file will be written. (the same with FS16).
    Kind regards
    Maike
    Edited by: Maike Nemeyer on Dec 1, 2011 8:52 AM
    Edited by: Maike Nemeyer on Dec 1, 2011 11:45 AM

  • Cutting and pasting tables from one project to another

    When cutting and pasting existing tables from one project to
    another, the line weights for the cell borders seem to vary at
    random - some are the original line weight and some are heavier
    when pasted.
    I've tried sorting things out with the table properties
    dialogue, but to no effect.
    Is there a quick fix, or am I better importing in whole
    topics and then editing the imported topic?

    Hi Colum/Peter,
    It's not a custom table, I just need to copy an existing
    table from one project to another.
    My blasted developers (may the fleas of a thousand camels,
    etc), just decided to change the toolbars in one of our
    applications. As this toolbar appears in slightly different guises
    in about 6 tabs, I was trying to update the table that shows what
    icon does what and cut and paste that table into all the sub
    projects I have. Each table then only needs a minor edit for a few
    icons specific to that sub-project.
    Peter's on the right track. When I cut and pasted the table
    it also pasted in a number of lines of HTML associated with the
    styles in the other project. If I delete those lines, the table
    then appears as it should.
    Thanks for prompt response

  • Copy Custom toolbar from one instance to another in Project server 2007

    Hi,
    I am currently using project server 2007. We have a number of instances in our Project server enivoronment. Is it possible to copy customized toolbar from one instance to another? If yes, how?
    Thanks in advance 

    Hi Khaldun,
    As per my reply in your previous post, here is a link explaining how to use the organizer:
    Http://blogs.msdn.com/b/project/archive/2010/10/22/tips-and-tricks-copy-custom-views-filters-tables-and-other-elements-to-other-projects.aspx?Redirected=true
    Basically, just copy the toolbar from the global source instance into a blank project file. Then do the same operation from the blank file containing your toolbar into the destination global model, still using the organizer. 
    Hope this helps. 
    Guillaume Rouyre - MBA, MCP, MCTS

  • How to Copy the PLD from one database to another

    Dear Members,
       i have designed the  PLD for Purchase Order, i want to copy the particular PLD into another Database.
    i tried to copy the PLD from one database to another through copy express.. i copied the PLD sucessfully. But the problem is,it copies all PLD's from one database to another. i want only the Purchaseorder PLD has to be copied in to another database.any body can help me in this regard.
    With Regards,
    G.shankar Ganesh

    Hi,
    select * into A1 from RDOC where Author !='System'
    select *  into A2  from  RITM   where Doccode  in (select Doccode from A1 )
    select * from A1
    select * from A2
    sp_generate_inserts 'A1'
    sp_generate_inserts 'A2'
    you will get Insert scripts of A1 and A2 tables .After that You 'll  Replace A1 to RDOC and A2 to RITM.
    So that you can RUN this SQL srcipts any where (In any Database)
    but First u have to run sp_generate_inserts  Storeprocedure(from websites) .
    drop table A1,A2

Maybe you are looking for

  • App errors for some kind of PDF-documents

    Hello, we are getting java.lang.NullPointerExceptions for some PDF-documents to be Rights Management protected by using com.adobe.livecycle.rightsmanagement.RightsManagementService.applyPolicy() Client-side gets this exception:     System.Web.Service

  • I keep losing my printers from the network

    Yep. This has been going on since I did a full restore to my MacBook. I keep losing the connection to my two wireless printers. I go to print and and the printer que says that the printers are not connected. Then, amazingly enough, they get reconnect

  • How to Configure Solution Manager 3.2 for Support Desk

    Please give me information for configure solution manager 3.2 for support desk. What r the steps to configure ?. satinder lamba

  • Podcasts have stopped updating and now I have to manually download from the store/libra

    Starting about two months ago my podcasts stopped automatically downloading on my iPhone 4s so now I have to go into the store and download ea episode manually which is a PITA. I have tried deleting the podcast app and deleting the subscribed podcast

  • How to maintain production version for material and how it will work

    Dear Friends,                       i  have created alternative bom for a material , My FG is having two  RM1 and RM2. like below,                  FG --->RM1                 FG---->RM2 i created alternative BOM. how it will fetch raw materils from B