oracle导出序列

SELECT ' CREATE SEQUENCE '||SEQUENCE_NAME|| ' INCREMENT BY '||INCREMENT_BY ||' START WITH '||LAST_NUMBER||' MAXVALUE '||MAX_VALUE ||' CACHE '||CACHE_SIZE||' ORDER NOCYCLE ;' FROM user_SEQUENCES;

 

 

结果类似:

  CREATE SEQUENCE ARTCOMMENT_SEQ INCREMENT BY 1 START WITH 341 MAXVALUE 999999999999999999999999999 CACHE 20 ORDER NOCYCLE ;

  CREATE SEQUENCE ARTICLEVISTCECOLLECT_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 999999999999999999999999999 CACHE 20 ORDER NOCYCLE ;

  CREATE SEQUENCE ARTICLEVISTTEMP_SEQ INCREMENT BY 1 START WITH 82989 MAXVALUE 999999999999999999999999999 CACHE 20 ORDER NOCYCLE ;

  CREATE SEQUENCE ARTICLEVIST_SEQ INCREMENT BY 1 START WITH 1675 MAXVALUE 999999999999999999999999999 CACHE 20 ORDER NOCYCLE ;

  CREATE SEQUENCE ARTICLE_SEQ INCREMENT BY 1 START WITH 1908 MAXVALUE 999999999999999999999999999 CACHE 20 ORDER NOCYCLE ;

 

 

 

以上经过测试,导出序列为上述格式

 

下面未经测试

select dbms_metadata.get_ddl('SEQUENCE',u.object_name) from user_objects u where object_type='SEQUENCE'

你可能感兴趣的:(oracle)