DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: SEQUENCE Question... Help!

  1. #1
    Join Date
    Mar 2001
    Posts
    26
    Hi guys,

    I'm copying data from one database to another. But, before I do this, I need to copy the sequence information. My question is: What internal system table contains this information so I can copy to the other database to avoid integrity constraint problems??

    Thanks in advance.

    - Gary

  2. #2
    Join Date
    Aug 2000
    Location
    Ny
    Posts
    105
    You should not mess with sys tables, just copy the hole table with the sequence and then create a sequence in the new db starting with the max(sequence_num) from the table.

  3. #3
    Join Date
    Aug 2000
    Posts
    462
    DBA_SEQUENCES will give you the max value, but I agree with Highlander. Why mess with that when you have the data? Just query the column which stores the sequence values, and start with that number + whatever increment you intend to use.
    Oracle DBA and Developer

  4. #4
    Join Date
    Mar 2001
    Posts
    635
    Hi

    I think a export and import would be a better option

    export from ur source database

    import into the target database

    Regards
    Santosh

  5. #5
    Join Date
    Jun 2001
    Location
    Pune
    Posts
    1

    Post

    I would agree with SantoshYN. Since you are copying one database to another the safest way would be to export the source database and import the target database. that way you ensure all the system tables are also copied.

    But if it s specifically only data from some tables then you would need to export only those tables from the source database and recreate the sequence in the target database with the max +1 sequence value in the target database as suggested by highlander.

  6. #6
    Join Date
    Mar 2001
    Posts
    26
    Thanks for all your replies. That exactly what I'll do... recreate the sequences...

    Thanks,
    - Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width