How could I copy contraints from one database to another?

Hi,
I have a specific problem.
I have taken a datadump and executed in another database. Some how the contraints were not copied.
So I created following script to genrated alter statement and then run the script in target database:
declare
cursor get_cons is
select distinct dc.table_name table_name, decode ( substr(dc.constraint_name,1,3), 'SYS', ' ', 'CONSTRAINT ' dc.constraint_name ) contraint, wmsys.wm_concat(ucc.column_name) over ( partition by dc.constraint_name order by dc.constraint_name ) cols
from user_constraints dc,
user_cons_columns ucc
where dc.table_name like '%'
and dc.constraint_type = 'P'
and dc.table_name = ucc.table_name
and dc.constraint_name = ucc.constraint_name;
lv_sql varchar2(2000);
begin
for i in get_cons
loop
lv_sql := 'ALTER TABLE '
I.TABLE_NAME
+' ADD ('+
i.contraint
+' PRIMARY KEY ( '+
I.COLS
+' )); ';+
dbms_output.put_line( lv_sql );
end loop;
end;
Is there a better way to do it?
Thank You,
Ranjeeth

Hi,
do u have idea about move data from development environment to production environment.
what is the simpleast way. suppose if we refer DATAPUMP or EXP/IMP. How to do it.
through EXP command i am exporting full database or specified tables. but problem is i am not able import which i exported tables.
can u give me the steps to how to import .DMP files through command prompt.
Thanks
Venkat.

Similar Messages

  • 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 can i copy apps from one computer to another?

    how can i copy apps from one computer to another?

    You don't mention which operating system you have so it's difficult to provide an answer since the mac and Windows stores the files differently.
    The other thing you can do is just re-download the apps from the iTunes Store. Just login to the iTunes Store on the other computer using the same Apple ID. On the right-hand side of the iTunes Store page you will see a 'Purchased' link. Clicking on that will take you to a page that will list your past purchases which you can re-download to the new computer.

  • How can I copy text from one card to another while creating cards using Iphoto?

    I created two cards with different pictures using Iphoto on Macnotebook. 
    I want to use the same text message.
    How can I copy text from one card to another?

    select the text and copy (edit menu ==> copy) tehn gpo to the next card and paste
    LN

  • How do I copy text from one layer to  another?

    I have Googled this but not a single answer seems to work.
    I am using Photoshop CS4 on OS X 10.6.7.
    OK, so  I  have a layer that  has some text in it.  I would like to  be able to  simply copy that  text  from one layer  to  another, but this seems to  be impossible as the Edit Paste menu item is grayed out after I have copied it in to the clipboard.  I can paste it into  the SAME layer, but not into another layer.
    This is how I am trying to  do  this.
    In the layer  with the text, click on the "T" icon to  the left.
    Click on the text, in the layer that I  want to  copy. 
    I select the text (either  by  clicking and dragging or pressing Command-A).
    Next I press Command-C.
    Then I  click on the layer In the Layer Panel) where I want to  paste the text.
    Pressing Command-V is impossible because the Edit-Paste menu option is grayed out!!!!
    WHY??????
    Perhaps more importantly, HOW do I copy text  from one layer to  another?

    First thing you can simply right click on the Text Layer and choose Duplicate Layer.  But that will create a new Text Lay
    er identical to the one you have.
    To answer your question in your case....  Create the Text Layer.   Make a New Layer.  Or have the layer you want to paste into visible.
    Highlight the text layer in the Layer Palette and Ctrl+Click (Win) Cmd+Click(Mac) so that you see marching ants walking around your text.
    Edit>Copy.
    Then highlight your Layer you want to paste into and hit Edit>Paste or Cmd+V / Ctrl+V.

  • HT3819 how do I copy songs from one ipod to another

    How do I copy songs from one ipod to another?

    Transfer the songs to iTunes and then sync to the other iPod.

  • How do I copy photos from one iPad to another iPad?

    How do I copy photos from one ipad to another ipad without using my Mac?

    https://appsto.re/us/SQ8Wv.i
    This app helps you to upload easy all you photos by selecting all
    to your dropbox account,
    to Google Drive,
    To your computer,
    to another device,

  • How do i copy music from one ipod to another with 1 cord?

    how do i copy music from one ipod to another with 1 cord?

    You cannot copy content directly from one iPod to another. If the music was purchased from the iTunes Store, you have the following options:
    - sync the iPod to your computer, transfer the content to iTunes, and then connect the other iPod and sync from iTunes
    - use iCloud (which requires iOS 5).
    - download the music from from the iTunes Store to the second iPod. See:
    http://support.apple.com/kb/ht2519
    Regards.
    Message was edited by: varjak paw

  • How do you copy files from one user to another

    How do you copy files from one user to another user on the same machine?

    open your home folder in finder move file to public, log into other account, click the go tab on the finder menu, select computer, your hard drive (Macintosh HD Default)>Users, the origonal user> public and drag that file to your specified folder.
    hope it works
    Craig.

  • How do you copy automation from one track to another?

    How do you copy automation from one track to another? Occassionally I mistakenly blow away a track's automation. I open up an earlier version of the song to try to get the automation. It doesn't seem that you can copy and paste the data. After some struggle, I find a way. Is there an easy way?

    1. Copy the track containing the desired automation to another track. (create a track below it to keep things organized)
    2. Double click on the region and delete the notes.
    3. Now copy the region to the desired track.
    P.S. Of course when Logic asks if you want to copy the automation data you say yes)

  • How do I copy recordsets from one database table to another?

    I am using the Database Connectivity Toolset, and would like to copy either one recordset or multiple recordsets from one Access table to a table in a different database. I would like to do it directly with the data in variant form, but I can't get it to work. I can get it to work(on a small test table) if I first convert my source variant data to a cluster, then insert that into the other database table. My real database has many items with a variety of date types. Can I copy directly variant to variant?

    Is it necessary to read all the data back into LabVIEW first? The reason I'm asking is that it is much more efficient to just use SQL statements to get the data you need and write that directly to the second database. I did a quick Google search on it and came up with lots of responses on what the correct syntax is for setting that up. Using an SQL command to copy the data back and forth is analogous to copying data from one file to another using the Copy file function rather than reading the entire contents of the file, converting the file string to the data arrays, converting back to a string, and then writing it back to another file.
    Chapter 5 of the Database Connectivity Toolset User Manual describes how to execute SQL queries.
    If you do need to actually
    see the data in LabVIEW first, then the only way to get it back into the other database is to convert those variants to LV datatypes and then cluster those values again and write them back out to the second database.

  • Copy table from one database to another database

    Hi,
    I am new to SQL and I have a question on copying a table.
    QUE: copy one table with huge data(around 60millions of rows) from one database to another database(have to create a new table) in the same server. 

    Hi ,
    By mistake ,I understood you want to copy on different server .
    I have rectify above.On same server we can copy Table in many way ;
    As I mentioned Above you can use ;
    select * into [Destination Database].[dbo].[NewTableName] from [SourceDatabase].[dbo].[Category]
    Second;
    select * into [Destination Database].[dbo].[NewTableName] from [SourceDatabase].[dbo].[Category] Where 1=2
    Insert into [Destination Database].[dbo].[NewTableName]
    select * from [SourceDatabase].[dbo].[Category]
    Thanks

  • How can I copy songs from one iPod to another?

    I received a new iPod Classic (last generation) and I'm trying to transfer my songs from my old iPod Nano (also last generation).
    My iTunes library is also split up between my two parent's houses and I only have half the songs on my Nano in this computer's library.
    Is there a way to copy only the songs on the +iPod Nano+ (not the iTunes library) and drop them onto the new iPod?

    *Is there a way to copy only the songs on the iPod Nano (not the iTunes library) and drop them onto the new iPod?*
    You can't copy directly from one iPod to another, you have to copy the songs back to iTunes and update the new iPod from there. If you have any iTunes Music Store purchases the transfer of purchased content from the iPod to authorised computers was introduced with iTunes 7. You'll find details in this article: Copying iTunes Store purchases from your iPod to a computer
    The transfer of content from other sources such as songs imported from CD is designed by default to be one way from iTunes to iPod. However there are a number of third party utilities that you can use to retrieve the music files and playlists from your iPod. You'll find that they have varying degrees of functionality and some will transfer movies, videos, photos, podcasts and games as well. Have a look at the web pages and documentation, this is just a small selection of what's available, they are generally quite straightforward. You can read reviews of some of them here: Wired News - Rescue Your Stranded Tunes
    TuneJack Windows Only
    iPod2PC Windows Only
    iGadget Windows Only
    iDump Windows Only
    SharePod Windows Only
    iRepo Mac and Windows
    iPodRip Mac & Windows
    YamiPod Mac and Windows
    Music Rescue Mac & Windows
    iPodCopy Mac and Windows
    There is also a manual method of accessing the iPod's hard drive and copying songs back to iTunes on Windows or a Mac. The procedure is a bit involved and won't recover playlists but if you're interested it's available at this link: Two-way Street: Moving Music Off the iPod

  • How to Add Sales order from one database to another database

    Hi All,
    I am trying to add sales order with sales order object.
    I have completed connectivity from one database to another database.
    but i am unable to post sales order with orders object.
    My code is
    ObjSales = objMain.objUtilities.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
                ObjSales.DocDate = Date.Parse(System.DateTime.Now().ToString("d"))
                ObjSales.DocDueDate = Date.Parse(System.DateTime.Now().ToString("d"))
                ObjSales.TaxDate = Date.Parse(System.DateTime.Now().ToString("d"))
                ObjSales.CardCode = "C0006"
               ObjSales.Series = 92
                ObjSales.PaymentGroupCode = 3
                ObjSales.Comments = "vivek"
               ObjSales.Lines.Add()
               ObjSales.Lines.SetCurrentLine(1)
               ObjSales.Lines.ItemCode = "5127"
               ObjSales.Lines.Quantity = 100
               ObjSales.Lines.UnitPrice = 10
               ObjSales.Lines.WarehouseCode = "01"
                ObjSales.Lines.TaxCode = "0"
                ObjSales.Lines.DiscountPercent = "0.00"
                ObjSales.DocTotal = 1000
                 If ObjSales.Add <> 0 Then
                   objMain.objApplication.SetStatusBarMessage("Sales or Not Posted", SAPbouiCOM.BoMessageTime.bmt_Short, True)
                   Exit Sub
                else
                  objMain.objUtilities.ShowSuccessMessage("Sales Order Posted successfully")
                End If
    The above code is executing successfully.But the Sales order is not getting added.
    Thanks in advance.

    Hi Vivek,
    If the code you posted is not throwing any errors, then the order really does get created. Apparently just not to both databases, am I correct ?
    vivek.Y wrote:
    > I have completed connectivity from one database to another database.
    That means that apparently you have not gotten this bit right.
    Generally speaking if you want to create an order into two databases, you first need to connect to both databases and create separate order objects for each database. So you need to do this bit twice; once for each database. Something like this:
    ObjSales1 = objMain.objUtilities1.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
    ObjSales2 = objMain.objUtilities2.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
    Then at the end you also need to add both objects separately:
    If ObjSales1.Add <> 0 Then
    etc.
    If ObjSales2.Add <> 0 Then
    etc
    Good luck,
    Johan

  • How do I copy layers from one image to another?

    I am editing figures for a journal and I need arrows for multiple images.  Is there a standard arrow?  I can only see free hand.  If I use a free hand arrow I then want to copy it to the other images for consistency.  How do I copy or share layers between images?

    There are many arrows in the shape tool, or you can set the line tool to have an arrowhead in the tool options. You can copy/paste layers from one image to another, or drag a layer from the layers panel into the main image window of another image and then use the move tool to position it. You can also drag into the thumbnail in the photo bin, but you'll still need to bring the image up to adjust the positioning.

Maybe you are looking for

  • IT 0128(Notifications): Error:could not read text

    Hi All When I am trying to create subtype for IT 0128,it is showing error as "could not read text".Please help in solving the issue. Regards Ritu Saurabh

  • OSX Lion can't read it's own burned mp3 cd

    Hello, I have a weired problem with mp3 cds on my Mac Mini running OSX Lion. I burned some mp3 cd with iTunes. Now few days later the same mac doesn't read them any more. It says i put a blank disk in it. When i confirm to open it with finder, it is

  • Coloring a line

    Using the below I'm not getting the whole line colored.  Can you please check why is that?             FORMAT COLOR 7 INTENSIFIED ON.                   WRITE AT 45'BA'.                    new-line.                    WRITE AT 28 'British Airways'.

  • I just updated to Premiere Pro CC 2014 and it can't start up

    I just updated to Premiere Pro CC 2014, and now I am seeing an error message saying it cannot find any capable play modules. I updated the driver for my graphics card (Firepro), and tried running as administrator with no change. I am running amd fire

  • Time Evaluation.

    Dear Experts, Can anyone explain, how time evaluation schema is linked to time management status in the infotype 0007. Regards, Durga.