加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Oracle 软件测试工程师日常工作中常用到的查询语句(除功能业务

发布时间:2020-12-12 14:35:23 所属栏目:百科 来源:网络整理
导读:--如何查看各个表空间占用磁盘情况?SQL col tablespace format a20 SQL select b.file_id 文件ID号,b.tablespace_name 表空间名,b.bytes 字节数,(b.bytes-sum(nvl(a.bytes,0))) 已使用,sum(nvl(a.bytes,0)) 剩余空间,0))/(b.bytes)*100 剩余百分比 from dba

--如何查看各个表空间占用磁盘情况?
SQL> col tablespace format a20 
SQL> select b.file_id 文件ID号,b.tablespace_name 表空间名,b.bytes 字节数,(b.bytes-sum(nvl(a.bytes,0))) 已使用,sum(nvl(a.bytes,0)) 剩余空间,0))/(b.bytes)*100 剩余百分比 from dba_free_space a,dba_data_files b where a.file_id=b.file_id group by b.tablespace_name,b.file_id,b.bytes order by b.file_id


--查看本用户下的各种对象的SQL脚本 表:   
select * from cat;   
select * from tab;   
select table_name from user_tables;


--视图:   

select text from user_views where view_name=upper('&view_name');


--索引:   

select index_name,table_owner,table_name,tablespace_name,status from user_indexes order by table_name;

--触发器:   

select trigger_name,trigger_type,status from user_triggers;


--快照:   

select owner,name,master,last_refresh,next from user_snapshots order by owner,next;


--同义词:   

select * from syn;


--序列:   

select * from seq;


--数据库链路:   

select * from user_db_links;


--约束限制:   

select TABLE_NAME,CONSTRAINT_NAME,SEARCH_CONDITION,STATUS from user_constraints;


--本用户读取其他用户对象的权限:   

select * from user_tab_privs;


--本用户所拥有的系统权限:   

select * from user_sys_privs;


--用户:   

select * from all_users order by user_id;


--表空间剩余自由空间情况:   

select tablespace_name,sum(bytes) 总字节数,max(bytes),count(*) from dba_free_space group by tablespace_name;


--数据字典:   

select table_name from dict order by table_name;



--锁及资源信息(不包含DDL锁):   

select * from v$lock;


--数据库字符集:   

select name,value$ from props$ where name='NLS_CHARACTERSET';


--inin.ora参数:   

select name,value from v$parameter order by name;


--SQL共享池:   

select sql_text from v$sqlarea;


--数据库:   

select * from v$database


--控制文件:   

select * from V$controlfile;


--重做日志文件信息:   

’select * from V$logfile;


--来自控制文件中的日志文件信息:   

select * from V$log;


--来自控制文件中的数据文件信息:   

select * from V$datafile;


--NLS参数当前值:   

select * from V$nls_parameters;


--ORACLE版本信息:   

select * from v$version;


--描述后台进程:   

select * from v$bgprocess;


--查看版本信息:   

select * from product_component_version;

--如何查看各个表空间占用磁盘情况?
SQL> col tablespace format a20 SQL> select b.file_id 文件ID号,value from v$parameter order by name;


--SQL共享池:   

select sql_text from v$sqlarea;


--数据库:   

select * from v$database


--控制文件:   

select * from V$controlfile;


--重做日志文件信息:   

’select * from V$logfile;


--来自控制文件中的日志文件信息:   

select * from V$log;


--来自控制文件中的数据文件信息:   

select * from V$datafile;


--NLS参数当前值:   

select * from V$nls_parameters;


--ORACLE版本信息:   

select * from v$version;


--描述后台进程:   

select * from v$bgprocess;


--查看版本信息:   

select * from product_component_version;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读