- 1、本文档共56页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
oracle_11g_学习笔记
1、常用oracle参数查询
1、查看控制文件
select name from v$controlfile;
2、查看日志文件
select member from v$logfile;
3、查看表空间的使用情况
select sum(bytes)/(1024*1024) as free_space_MB,tablespace_name
from dba_free_space
group by tablespace_name;
SELECT A.TABLESPACE_NAME,A.BYTES/(1024*1024*1024) TOTAL_GB,B.BYTES/(1024*1024*1024) USED_GB, C.BYTES/(1024*1024*1024) FREE_GB,
(B.BYTES*100)/A.BYTES % USED,(C.BYTES*100)/A.BYTES % FREE
FROM SYS.SM$TS_AVAIL A,SYS.SM$TS_USED B,SYS.SM$TS_FREE C
WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME AND A.TABLESPACE_NAME= C.TABLESPACE_NAME;
4、查看数据库库对象
select owner, object_type, status, count(*) count# from all_objects group by owner, object_type, status;
5、查看数据库的版本
Select version FROM Product_component_version
Where SUBSTR(PRODUCT,1,6)=Oracle;
6、查看数据库的创建日期和归档方式
Select Created, Log_Mode, Log_Mode From V$Database;
7、捕捉运行很久的SQL
column username format a12
column opname format a16
column progress format a8
select username,sid,opname,
round(sofar*100 / totalwork,0)||% as progress,
time_remaining,sql_text
from v$session_longops , v$sql
where time_remaining 0
and sql_address = address
and sql_hash_value = hash_value
/
8、查看数据表的参数信息
SELECT partition_name, high_value, high_value_length, tablespace_name,
pct_free, pct_used, ini_trans, max_trans, initial_extent,
next_extent, min_extent, max_extent, pct_increase, FREELISTS,
freelist_groups, LOGGING, BUFFER_POOL, num_rows, blocks, empty_blocks, avg_space, chain_cnt, avg_row_len, sample_size,
last_analyzed
FROM dba_tab_partitions
--WHERE table_name = :tname AND table_owner = :towner
ORDER BY partition_position
9、查看还没提交的事务
select * from v$locked_object;
select * from v$transaction;
10、查找object为哪些进程所用
select
p.spid,
s.sid,
s.serial# serial_num,
s.username user_name,
a.type object_type,
s.osuser os_user_name,
a.owner,
a.object object_name,
decode(sign(48 - command),
1, to_char(command), Action Code # to_char(command
文档评论(0)