Home » SQL & PL/SQL » SQL & PL/SQL » Import and export tables resets sequences. Why?
Import and export tables resets sequences. Why? [message #20862] Wed, 26 June 2002 02:41 Go to next message
David
Messages: 110
Registered: November 1998
Senior Member
Hi,
I am exporting a DB and then Importing it into another. As a result the sequences are again set to 1. How can I keep their original value?

The statements I am using are :
exp s/r@slbackup file=a.dmp log=a.log rows=yes indexes=n tables= LB_CD_SHELVES , ....

then I drop all the tables and import

imp s/r@idoc1 file=a.dmp log=a.log rows=yes indexes=n tables=LB_CD_SHELVES, ...

Thanks.
Re: Import and export tables resets sequences. Why? [message #20864 is a reply to message #20862] Wed, 26 June 2002 08:47 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
try these.
create the sequences with NOCACHE option and
use consistent=Y during export.
Re: Import and export tables resets sequences. Why? [message #20868 is a reply to message #20862] Wed, 26 June 2002 12:35 Go to previous messageGo to next message
Grant
Messages: 578
Registered: January 2002
Senior Member
The export you are doing does not export sequences. Also, as far as I know Oracle doesn't RESET sequences when you import. If it did you would have constraint violations for all primary keys. Unless I am missing something you should be contacting Oracle Support or you need to provide more info on what you are doing.

As a side note I was curious so I did a FULL, USER, and TABLE export and looked at the export to see what it would do on import. All sequences maintained their current value except on the table export where no sequences were exported even with CONSISTENT=Y.
Re: Import and export tables resets sequences. Why? [message #20901 is a reply to message #20864] Fri, 28 June 2002 04:16 Go to previous messageGo to next message
E
Messages: 2
Registered: June 2002
Junior Member
d
Re: Import and export tables resets sequences. Why? [message #21486 is a reply to message #20868] Wed, 07 August 2002 07:04 Go to previous message
David
Messages: 110
Registered: November 1998
Senior Member
You are right. It does not export the sequences. I had some left-overs from the schema creation process which messed up my results. Sorry...

THE PROBLEM NOW IS :
How do I export the sequences together with the tables and their data? I want to be able to work on schema1 export it , import it into schema2 and then continue working on schema 2 without loosing the sequneces .

Is it possible ?

Thank you in sdvance
David
Previous Topic: prevent drop of table
Next Topic: Iteration function in the select statement
Goto Forum:
  


Current Time: Fri Apr 19 03:21:18 CDT 2024