dbTalk Databases Forums  

Sequence value after data refresh

comp.databases.oracle.server comp.databases.oracle.server


Discuss Sequence value after data refresh in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sankarKK
 
Posts: n/a

Default Sequence value after data refresh - 03-31-2011 , 12:56 PM






hi ,

after refreshing testdb from proddb I'm having an issue

We have 100 records in a table in testdb. Sequence=100.
200 records have been copied over from proddb. Sequence is still
100.
When we try to insert next record, trigger tries to insert value 101
for the
sequence, and it causes error (value not unique). So, value of
sequence has be
be taken from the db where we get data.
I'am confused that user has been dropped with cascade, so all objects
have been dropped in testdb, imported newly from proddb,
how sequence value is showing old nextval.

thanks
tcy

Reply With Quote
  #2  
Old   
Matthias Hoys
 
Posts: n/a

Default Re: Sequence value after data refresh - 03-31-2011 , 04:41 PM






"sankarKK" <xtapas (AT) gmail (DOT) com> wrote

Quote:
hi ,

after refreshing testdb from proddb I'm having an issue

We have 100 records in a table in testdb. Sequence=100.
200 records have been copied over from proddb. Sequence is still
100.
When we try to insert next record, trigger tries to insert value 101
for the
sequence, and it causes error (value not unique). So, value of
sequence has be
be taken from the db where we get data.
I'am confused that user has been dropped with cascade, so all objects
have been dropped in testdb, imported newly from proddb,
how sequence value is showing old nextval.

thanks
tcy
How did you copy the 200 records from the proddb to the testdb? After the
schema refresh?

Matthias

Reply With Quote
  #3  
Old   
onedbguru
 
Posts: n/a

Default Re: Sequence value after data refresh - 04-01-2011 , 04:15 PM



On Mar 31, 1:56*pm, sankarKK <xta... (AT) gmail (DOT) com> wrote:
Quote:
hi ,

after refreshing testdb from proddb *I'm having an issue

*We have 100 records in a table in testdb. Sequence=100.
* * 200 records have been copied over from proddb. Sequence is still
100.
When we try to insert next record, trigger tries to insert *value 101
for the
sequence, and it causes error (value not unique). So, value of
sequence has be
be taken from the db where we get data.
I'am confused that user has been dropped with cascade, so all objects
have been dropped in testdb, imported newly from proddb,
how sequence value is showing old nextval.

thanks
tcy
Now let's think about this... you said that you "imported" from the
proddb - correct?? Import will create the user and ALL of it's objects
including the sequences with the PRODDB values - even if you only
created an empty schema. Test it and see.

Not sure the concept is that difficult as to cause such confusion.

Reply With Quote
  #4  
Old   
Mark D Powell
 
Posts: n/a

Default Re: Sequence value after data refresh - 04-02-2011 , 12:36 PM



On Apr 1, 5:15*pm, onedbguru <onedbg... (AT) yahoo (DOT) com> wrote:
Quote:
On Mar 31, 1:56*pm, sankarKK <xta... (AT) gmail (DOT) com> wrote:





hi ,

after refreshing testdb from proddb *I'm having an issue

*We have 100 records in a table in testdb. Sequence=100.
* * 200 records have been copied over from proddb. Sequence is still
100.
When we try to insert next record, trigger tries to insert *value 101
for the
sequence, and it causes error (value not unique). So, value of
sequence has be
be taken from the db where we get data.
I'am confused that user has been dropped with cascade, so all objects
have been dropped in testdb, imported newly from proddb,
how sequence value is showing old nextval.

thanks
tcy

Now let's think about this... you said that you "imported" from the
proddb - correct?? Import will create the user and ALL of it's objects
including the sequences with the PRODDB values - even if you only
created an empty schema. Test it and see.

Not sure the concept is that difficult as to cause such confusion.- Hide quoted text -

- Show quoted text -
tcy, a couple of facts you can check: is the sequence in question
owned by the schema that was dropped and recreated? If the sequence
owner is different that would be one possibility. Another possibility
if you were not the individual to drop the user is that instead of
dropping and re-creating the user who ever prepared the account to be
imported just dropped the user tables and indexes missing dropping the
sequences.

HTH -- Mark D Powell --

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.