sql checkdb
--SESSION:
select * from gv$RESOURCE_LIMIT where RESOURCE_NAME='sessions';
--DATAFILE
select round((sum(a.bytes_alloc)-sum(nvl(b.bytes_free, 0)))/1024/1024/1024,3) "used ",
round(sum(a.bytes_alloc)/1024/1024/1024,2) "total "
from (select f.tablespace_name,
sum(f.bytes) bytes_alloc
from dba_data_files f
group by tablespace_name) a,
(select f.tablespace_name,
sum(f.bytes) bytes_free
from dba_free_space f
group by tablespace_name) b
where a.tablespace_name = b.tablespace_name (+);
--TBS
select* from (
select df.tablespace_name "Tablespace",df.bytes/(1024*1024) "Total Size(MB)",
sum(fs.bytes)/(1024*1024) "Free Size(MB)", round(sum(fs.bytes)*100/df.bytes) "% Free",
round((df.bytes-sum(fs.bytes))*100/df.bytes) "% Used"
from dba_free_space fs,
(select tablespace_name, sum(bytes) bytes from dba_data_files group by tablespace_name ) df
where fs.tablespace_name = df.tablespace_name
group by df.tablespace_name, df.bytes
) ORDER BY 5 DESC;
--archive log
select trunc(completion_time),round(sum(mb)/1024,2)||' G' day_GB from
(select name,completion_time,blocks*block_size/1024/1024 mb from v$archived_log
where creator='ARCH' AND completion_time>sysdate-3 )
group by trunc(completion_time)
order by 1--SQL01;
select * from dba_jobs
where BROKEN<>'N'
--75956;
select * from dba_objects
where status='INVALID';
--------------------?I/O------------------------------------
select c.* from (
SELECT
UPPER(b.username) username
, a.disk_reads disk_reads
, a.executions executions
, a.disk_reads / decode(a.executions, 0, 1, a.executions) reads_per_exec
, a.address
, a.sql_text || chr(10) || chr(10) sql
, A.MODULE
, a.last_load_time last_time
-- , a.sql_fulltext sql
FROM
sys.gv_$sql a
, dba_users b
WHERE
a.parsing_user_id = b.user_id
AND a.disk_reads > 1000
AND b.username NOT IN ('SYS','SYSTEM') ) c where c.reads_per_exec>=1000
ORDER BY
c.reads_per_exec desc;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25583515/viewspace-712961/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DBCC CHECKDB優化工具效能優化
- sqlserver 關於DBCC CHECKDB的總結SQLServer
- 使用DBCC CHECKDB工具修復資料庫XT資料庫
- Hallengren是SQl Server集備份和索引重建和DBCC checkdb一起的超級好用的工具SQLServer索引
- DBCC CheckDB-架構損壞。執行 DBCC CHECKCATALOG 嚴重錯誤。架構
- SQL%FOUND,SQL%NOTFOUND,SQL%ROWCOUNTSQL
- 【SQL】Oracle SQL monitorSQLOracle
- SQL in ORACLE and SQL ServerSQLOracleServer
- 【SQL】17 SQL 檢視(Views)、SQL Date 函式、SQL NULL 值、SQLView函式Null
- SQL注射/SQL Injection漏洞SQL
- 【SQL】19 SQL函式SQL函式
- SQL&PL/SQL (轉)SQL
- SQL------SQL效能分析SQL
- 【SQL Profile】coe_xfr_sql_profile.sql內容SQL
- SQL Server 管理常用的SQL和T-SQLSQLServer
- T-SQL、Jet SQL、PL-SQL 的含義SQL
- 【SQL】13 SQL 別名、SQL 連線(JOIN)、SQL INNER JOIN 關鍵字、SQL LEFT JOIN 關鍵字、SQL RIGHT JOIN 關鍵字、SQL FULL OUTER JSQL
- 【SQL】10 SQL UPDATE 語句SQL
- 【SQL】11 SQL DELETE 語句SQLdelete
- SQL SERVER中SQL優化SQLServer優化
- (17)sql注入與sql modeSQL
- SQL Deverlop連線SQL ServerSQLdevServer
- 【SQL】SQL資料型別SQL資料型別
- 使用sql生成sql指令碼SQL指令碼
- SQL Server 之 SQL 注入篇SQLServer
- sql%notfound、sql%rowcount和returnSQL
- 【SQL】SQL
- SQLSQL
- 【SQL】Oracle 19c SQL隔離詳解(SQL Quarantine)SQLOracle
- SQL 已死,但 SQL 將永存!SQL
- 【SQL】Oracle SQL處理的流程SQLOracle
- 【SQL】Oracle SQL共享池檢查SQLOracle
- 【SQL】9 SQL INSERT INTO 語句SQL
- 【SQL優化】SQL優化工具SQL優化
- sql tuning task和sql profileSQL
- 【SQL Server】--SQL隱碼攻擊SQLServer
- 使用sql*plus編輯sql文字SQL
- Sql Server系列:Transact-SQL概述SQLServer