oracle中如何查詢序列?
--查看當前用戶的所有序列 select SEQUENCE_OWNER,SEQUENCE_NAME from dba_sequences where sequence_owner='用戶名'; --查詢當前用戶的序列總數 select count(*) from dba_sequences where sequence_owner='用戶名';
select SEQUENCE_OWNER,SEQUENCE_NAME from dba_sequences where sequence_owner='PPNIE';
--生成刪除該用戶下的序列號的sql語句
select 'drop sequence ' ||SEQUENCE_NAME ||' ;' from dba_sequences where sequence_owner='PPNIE';
注意事項:
1. 必須以管理員身份登錄;
2. sequence_owner必須為大寫,不管你的用戶名是否大寫。只有大寫才能識別。