>데이터 베이스 >MySQL 튜토리얼 >Oracle查询所有序列

Oracle查询所有序列

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB원래의
2016-06-07 15:08:051884검색

--查看当前用户的所有序列select SEQUENCE_OWNER,SEQUENCE_NAME from dba_sequences where sequence_owner='用户名';--查询当前用户的序列总数select count(*) from dba_sequences where sequence_owner='用户名';--示例:select SEQUENCE_OWNER,SEQUENCE_NA

--查看当前用户的所有序列
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=’WGB;

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

SQL> select SEQUENCE_OWNER,SEQUENCE_NAME from dba_sequences
  2  where sequence_owner='WGB';

SEQUENCE_OWNER                 SEQUENCE_NAME
------------------------------ ------------------------------
WGB                            SEQ_FOR_TEST
WGB                            SEQ_WGB_ADMIN
WGB                            SEQ_WGB_COMMON
WGB                            SEQ_WGB_COMMONS
WGB                            SEQ_WGB_CONTACTOR
WGB                            SEQ_WGB_FACES
WGB                            SEQ_WGB_MEMBER
WGB                            SEQ_WGB_MESSAGE
WGB                            SEQ_WGB_MONEY_USER

已选择9行。

SQL> select count(*) from dba_sequences where sequence_owner='WGB';

  COUNT(*)
----------
         9



注意事项:

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

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


参考资料:

http://zhidao.baidu.com/question/140904731





성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.