Oracle查询所有序列
2012-10-03 14:24:41 来源:WEB开发网核心提示:--查看当前用户的所有序列select SEQUENCE_OWNER,SEQUENCE_NAME from dba_sequences where sequence_owner='用户名';--查询当前用户的序列总数select count(*) from dba_sequences where seq
--查看当前用户的所有序列 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必须为大写,不管你的用户名是否大写。只有大写才能识别。
在DBA_SEQUENCES,USER_SEQUENCES,ALL_SEQUENCES中有。具体列你可以
DESC DBA_SEQUENCES;查看
比如:
SQL> select SEQUENCE_OWNER,SEQUENCE_NAME from dba_sequences where sequence_owner='DBSNMP';
SEQUENCE_OWNER SEQUENCE_NAME
------------------------------ ------------------------------
DBSNMP MGMT_RESPONSE_CAPTURE_ID
DBSNMP MGMT_RESPONSE_SNAPSHOT_ID
SQL> select count(*) from dba_sequences where sequence_owner='DBSNMP';
COUNT(*)
----------
- ››oracle 恢复误删除的表和误更新的表
- ››Oracle分页查询排序数据重复问题
- ››Oracle创建dblink报错:ORA-01017、ORA-02063解决
- ››Oracle 提高SQL执行效率的方法
- ››Oracle 动态查询,EXECUTE IMMEDIATE select into...
- ››Oracle 11g必须开启的服务及服务详细介绍
- ››oracle性能34条优化技巧
- ››oracle数据库生成随机数的函数
- ››Oracle 数据库表空间容量调整脚本
- ››oracle单库彻底删除干净的方法
- ››Oracle创建表空间、创建用户以及授权、查看权限
- ››oracle 中 UPDATE nowait 的使用方法
更多精彩
赞助商链接