exporting sequences? [message #69190] |
Mon, 19 November 2001 21:27 |
K. Prakash babu
Messages: 46 Registered: July 2001
|
Member |
|
|
hi
I have around 100 sequences in one of my users. I need to export some of them and import into another user.
Pls. tell me the procedure to import only sequences.
----------------------------------------------------------------------
|
|
|
Re: exporting sequences? [message #69208 is a reply to message #69190] |
Wed, 21 November 2001 07:39 |
Suresh Vemulapalli
Messages: 624 Registered: August 2000
|
Senior Member |
|
|
there is no way to export only specific objects other than tables.but you can generate script and run in other schema/database.
use following script:
set heading off
set feedback off
select 'create sequence '||sequence_name||' increment by '
||INCREMENT_BY||' start with '||to_char(last_number+1)||' '||chr(10)||
decode(max_value,null,' NOMAXVALUE ',' maxvalue '||max_value)||
decode(cycle_flag,'Y','CYCLE',' NOCYCLE ')||
' cache '||cache_size||' ; ' from user_sequences
spool seq.sql
/
spool off
set feedback on
set heading on
copy above script and paste it in a file and run. it gives you sequence creation script( seq.sql).
run seq.sql in other DB/schema.
HTH
SURESH
----------------------------------------------------------------------
|
|
|