將某個用戶的全部sequence查詢出來,並拼成創建語句: PS::其中SCOTT是需要導出sequence的用戶,並且使用該腳本的用戶需要有訪問dba_sequences的許可權。 將本用戶下全部sequence查詢出來,並拼成創建語句: 轉:https://www.2cto.com/databas ...
將某個用戶的全部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