Oracle的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 dba_sequences where sequence_owner='SCOTT' --其中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
查询出来的结果
选中该列 control + c 复制出来就OK 了。
本文转自:https://blog.csdn.net/sinat_30314715/article/details/84025489