您的位置:首页 > 数据库 > Oracle

Oracle命令--查询语句

2013-05-31 17:10 399 查看
当前存在哪些表空间

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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: