将某个用户的全部sequence查询出来,并拼成创建语句:

select 'create sequence '||sequence_name||     
       ' minvalue '||min_value||     
       ' maxvalue '||max_value||     
       ' start with '||last_number||     
       ' increment by '||increment_by||     
       (case when cache_size=0 then ' nocache' else ' cache '||cache_size end) ||';'   
from dba_sequences where sequence_owner='SCOTT'

  PS::其中SCOTT是需要导出sequence的用户,并且使用该脚本的用户需要有访问dba_sequences的权限。

 

将本用户下全部sequence查询出来,并拼成创建语句:

select 'create sequence '||sequence_name||    
       ' minvalue '||min_value||    
       ' maxvalue '||max_value||    
       ' start with '||last_number||    
       ' increment by '||increment_by||    
       (case when cache_size=0 then ' nocache' else ' cache '||cache_size end) ||';'  
from user_sequences

  转:https://www.2cto.com/database/201309/244412.html

版权声明:本文为ZhaoHS原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/ZhaoHS/p/9724559.html