Oracle命令--查询语句

来源:互联网 发布:精易编程助手怎么用 编辑:程序博客网 时间:2024/06/08 03:43

当前存在哪些表空间
Select * from v$tablespace;

表空间有多大
Select tablespace_name,sum(bytes)/1024/1024 from dba_data_files group by tablespace_name;

表空间还剩多少空闲空间
Select tablespace_name,sum(bytes)/1024/1024 from dba_free_space group by tablespace_name;

查询imuse01用户所使用的缺省表空间
select default_tablespace from dba_users where username=’imuse01’;

查询imuse01用户所使用的临时表空间
select temporary_tablespace from dba_users where username=’imuse01’;

查询当前用户所拥有的角色
select * from session_roles;

查看违反唯一索引的表及列:
如果插入数据时系统提示:unique constraint (IMUSE01.SYS_C004960) violated.则说明在为IMUSE01用户插入数据时违反了唯一索引SYS_C004960。

查看违反唯一索引的表:
select table_name from user_indexes where index_name=’ SYS_C004960’;

查看违反唯一索引的列:
select column_name from user_ind_columns where index_name=’ SYS_C004960’;

查看编译无效的存储过程:
select object_name from user_objects where status=’INVALID’ and object_type=’ PROCEDURE’;

查看当前运行的实例名:
select instance_name from v$instance;

原创粉丝点击