-
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
-
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.
-
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
-
Hi
I think a export and import would be a better option
export from ur source database
import into the target database
Regards
Santosh
-
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.
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|