欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Oracle查询所有序列 有大用 有大大用

下面两行不必是系统用户,只要当前用户就可以

select * from user_sequences;

select * from user_objects where object_type='SEQUENCE';




注意事项:

  1. 必须以管理员身份登录;

  2. sequence_owner必须为大写,不管你的用户名是否大写。只有大写才能识别。


  1. --查看当前用户的所有序列

  2. select SEQUENCE_OWNER,SEQUENCE_NAME from dba_sequences where sequence_owner='用户名';


  3. --查询当前用户的序列总数

  4. select count(*) from dba_sequences where sequence_owner='用户名';


  5. --示例:

  6. select SEQUENCE_OWNER,SEQUENCE_NAME from dba_sequences  where sequence_owner=’WGB;


  7. select count(*) from dba_sequences where sequence_owner=’ WGB’;


  8. SQL> select SEQUENCE_OWNER,SEQUENCE_NAME from dba_sequences where sequence_owner='CHES';

  9. SEQUENCE_OWNER          SEQUENCE_NAME

  10. --------------------   ---------------------------

  11. CHES                CHE_PACKAGE_SEQ

  12. CHES                CHE_PART_SEQ

  13. CHES                CHE_SCHEDULE_SEQ

  14. CHES                CHE_TYPE_SEQ

  15. SQL> select count(*) from dba_sequences where sequence_owner='CHES';

  16. COUNT(*)

  17. ----------

  18. 4  

转载于:https://blog.51cto.com/meiling/2068571


来自 https://blog.csdn.net/weixin_33935777/article/details/92987905


普通分类: