摘要:
DBA日常维护程序:--FREE.SQL--TO VERIFY FREE SPACE IN TABLESPACES? --MINIMUM AMOUNT OF FREE SPACE? --DOCUMENT YOUR THRESHOLDS:?--=M?? SQL>SELECTTABLESPACE_NAME,SUM(BLOCKS) AS FREE_BLK,TRUNC(SUM(BYTES)/(1024*... 阅读全文
摘要:
46.造成等待的LOCK的信息,比如LOCK类型等:COL EVENT FORMAT A30 SET LINE 160 COL MACHINE FORMAT A10 COL USERNAME FORMAT A15 SELECT B.SID,B.SERIAL#,B.USERNAME,MACHINE,EVENT,WAIT_TIME,CHR(BITAND(P1,-16777216)/16777215)... 阅读全文
摘要:
23、查询表空间使用情况:SELECT A.TABLESPACE_NAME "空间名称", 100-ROUND((NVL(B.BYTES_FREE,0)/A.BYTES_ALLOC)*100,2) "占用率(%)", ROUND(A.BYTES_ALLOC/1024/1024,2) "容量(M)",ROUND(NVL(B.BYTES_FREE,0)/1024/1024,2) 空闲(M)",ROU... 阅读全文
摘要:
根据SID找ORACLE的某个进程:SQL> SELECT PRO.SPID FROM V$SESSION SES,V$PROCESS PRO WHERE SES.SID=21 AND SES.PADDR=PRO.ADDR;监控当前数据库谁在运行什么SQL语句:SQL>SELECT OSUSER, USERNAME, SQL_TEXT FROM V$SESSION A, V$SQLTEXT B ... 阅读全文
摘要:
查看表空间的名称及大小: SQL> SELECT T.TABLESPACE_NAME, ROUND(SUM(BYTES/(1024 * 1024)), 0) TS_SIZE FROM DBA_TABLESPACES T, DBA_DATA_FILES D WHERE T.TABLESPACE_NAME = D.TABLESPACE_NAME GROUP BY T.TABLESPACE_NA... 阅读全文