Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: export/import and sequences

Re: export/import and sequences

From: Muli Koppel <koppel_at_post.tau.ac.il>
Date: 1997/03/20
Message-ID: <01bc3549$9dbc9d80$2c214284@133.66.32.10.tau.ac.il>#1/1

janet <janet_at_telesph.com> wrote in article <332EAD53.3E72_at_telesph.com>...
> Hi gurus,
> i've checked dejanews but i don't see this exact topic
> covered. sorry for the newbie question.
>
> database 1:
> we have a table with a sequence. we export the table.
>
> database 2:
> we drop the table, we import it from above. (no special
> parameters)
>
> does the sequence get recreated?
> do the #'s on the 2 databases match? (this is what i really want)
> can i drop the sequence & not recreate it to make the #'s
> match?
>
> thanks
> janet
>

Hello Janet,

  1. Sequences are exported as part as a global schema export - either whole user or whole database. So if you are using keyword TABLES=tname sequence will not be created.
  2. Assume u did a whole user export, u got now a file containing the table and the sequence. both are importable, with the following restriction : sequence value will be the value of LAST_NUMBER of that sequence. LAST_NUMBER is an attribute of a sequence which can be shown in USER_SEQUENCES. It gets incremented depending on the CACHE value given while creating the sequence. so, let us figure the following scenario: on DB1 sequence seq1 was created with CACHE value of 20, starting with 1. You use it twice (select seq.nextval). Its value is now 2. You are doing user export. On DB2 you import the export file: both table & seq are created, but seq1 will have now the value of 21.

hope this helps.

Muli Koppel Received on Thu Mar 20 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US