USTLGBBL0015

download USTLGBBL0015

If you can't read please download the document

description

monit

Transcript of USTLGBBL0015

SQL> df -P | awk '+$5 >= 80 {print}'SP2-0734: unknown command beginning "df -P | aw..." - rest of line ignored.SQL> exitDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options[oracle@ustlsgbbl015 ~]$ df -P | awk '+$5 >= 80 {print}'[oracle@ustlsgbbl015 ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Sun Sep 20 21:29:18 2015Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> -2- Purpose: Who is blocking what... (sudo su - oracle ---- sql)SP2-0734: unknown command beginning "-2- Purpos..." - rest of line ignored.SQL> SQL> set echo offSQL> set line 10000SQL> column blocker format a11;SQL> column blockee format a10;SQL> column sid format 99999;SQL> column blocker_module format a15 trunc;SQL> column blockee_module format a15 trunc;SQL> SQL> select a.inst_id, 2 (select username from gv$session s where s.inst_id=a.inst_id and s.sid=a.sid) blocker, 3 a.sid, 4 (select module from gv$session s where s.inst_id=a.inst_id and s.sid=a.sid) blocker_module , 5 ' is blocking ' "IS BLOCKING", 6 b.inst_id, 7 (select username from gv$session s where s.inst_id=b.inst_id and s.sid=b.sid) blockee, 8 b.sid , 9 (select module from gv$session s where s.inst_id=b.inst_id and s.sid=b.sid) blockee_module 10 from gv$lock a, gv$lock b 11 where 12 --Modified to take care of issue where sid blocked on difft instances are not showing 13 -- Original Script 14 /* a.block = 1 15 and b.request > 0 16 and a.id1 = b.id1 17 and a.inst_id = b.inst_id 18 and a.id2 = b.id2 19 */ 20 -- Modified script 21 a.block 0 and 22 b.request > 0 23 and a.id1 = b.id1 24 and a.id2 = b.id2 25 and a.sid b.sid 26 order by 1, 2 27 /alter session set optimizer_mode=choose;no rows selectedSQL> Session altered.SQL> SQL> --3- Checking FRA SpaceSQL> SELECT 2 ROUND((A.SPACE_LIMIT / 1024 / 1024 / 1024), 2) AS FLASH_IN_GB, 3 ROUND((A.SPACE_USED / 1024 / 1024 / 1024), 2) AS FLASH_USED_IN_GB, 4 ROUND((A.SPACE_RECLAIMABLE / 1024 / 1024 / 1024), 2) AS FLASH_RECLAIMABLE_GB, 5 SUM(B.PERCENT_SPACE_USED) AS PERCENT_OF_SPACE_USED 6 FROM 7 V$RECOVERY_FILE_DEST A, 8 V$FLASH_RECOVERY_AREA_USAGE B 9 GROUP BY 10 SPACE_LIMIT, 11 SPACE_USED , 12 SPACE_RECLAIMABLE ;--4- tableSpacesset lines 1000 pages 1000SELECT a.tablespace_name "Tablespace", to_char(a.bytes/(1024*1024), FLASH_IN_GB FLASH_USED_IN_GB FLASH_RECLAIMABLE_GB PERCENT_OF_SPACE_USED----------- ---------------- -------------------- --------------------- 4 .16 0 4.02SQL> SQL> SQL> SQL> 2 '999,999,999.90') "Size (MB)", 3 to_char(a.bytes/(1024*1024)-b.bytes/(1024*1024), '999,999,999.90') "Used (MB)", 4 to_char(b.bytes/(1024*1024), '999,999,999.90') "Free (MB)", 5 to_char(round(((a.bytes-b.bytes)/a.bytes)*100, 2), '99.90') "% Used" FROM( SELECT tablespace_name, sum(bytes 6 ) bytes from dba_data_files group BY tablespace_name) a, 7 (SELECT tablespace_name, sum(bytes) bytes, max(bytes) largest from dba_free_space group BY tablespace_name ) 8 b WHERE a.tablespace_name=b.tablespace_name(+) ORDER BY 5 DESC;Tablespace Size (MB) Used (MB) Free (MB) % Used------------------------------ --------------- --------------- --------------- ------SYSTEM 1,500.00 564.81 935.19 37.65SYSAUX 1,500.00 561.56 938.44 37.44USERS 5.00 1.19 3.81 23.75SL_TXN_IDX_TBS 100.00 13.00 87.00 13.00SL_TXN_TBS 100.00 7.69 92.31 7.69SL_SD_IDX_TBS 100.00 3.94 96.06 3.94SL_SD_TBS 100.00 3.06 96.94 3.06UNDOTBS1 490.00 10.56 479.44 2.168 rows selected.SQL> SQL> ---5- TableSpace temporalSQL> SQL> set lines 3000 pages 5000SQL> SELECT a.tablespace_name || '--> TEMPORAL TBS' tablespace_name, 2 b.SIZEMB "Mb Total", a.FREEMB "Mb Free", 3 a.FREEMB/b.SIZEMB*100 "%Free" from 4 (SELECT tablespace_name, 5 trunc(SUM(bytes_free)/1024/2024) FREEMB 6 FROM v$temp_space_header 7 GROUP BY tablespace_name) a, 8 (SELECT tablespace_name, 9 trunc(SUM(bytes)/1024/1024) SIZEMB 10 FROM dba_temp_files 11 GROUP BY tablespace_name) b 12 where a.tablespace_name=b.tablespace_name;TABLESPACE_NAME Mb Total Mb Free %Free------------------------------------------------- ---------- ---------- ----------TEMP-->? TEMPORAL TBS 214 0 0SQL> SQL> !df -P | awk '+$5 >= 80 {print}'SQL> -2- Purpose: Who is blocking what... (sudo su - oracle ---- sql)SP2-0734: unknown command beginning "-2- Purpos..." - rest of line ignored.SQL> SQL> set echo offSQL> set line 10000SQL> column blocker format a11;SQL> column blockee format a10;SQL> column sid format 99999;SQL> column blocker_module format a15 trunc;SQL> column blockee_module format a15 trunc;SQL> SQL> select a.inst_id, 2 (select username from gv$session s where s.inst_id=a.inst_id and s.sid=a.sid) blocker, 3 a.sid, 4 (select module from gv$session s where s.inst_id=a.inst_id and s.sid=a.sid) blocker_module , 5 ' is blocking ' "IS BLOCKING", 6 b.inst_id, 7 (select username from gv$session s where s.inst_id=b.inst_id and s.sid=b.sid) blockee, 8 b.sid , 9 (select module from gv$session s where s.inst_id=b.inst_id and s.sid=b.sid) blockee_module 10 from gv$lock a, gv$lock b 11 where 12 --Modified to take care of issue where sid blocked on difft instances are not showing 13 -- Original Script 14 /* a.block = 1 15 and b.request > 0 16 and a.id1 = b.id1 17 and a.inst_id = b.inst_id 18 and a.id2 = b.id2 19 */ 20 -- Modified script 21 a.block 0 and 22 b.request > 0 23 and a.id1 = b.id1 24 and a.id2 = b.id2 25 and a.sid b.sid 26 order by 1, 2 27 /alter session set optimizer_mode=choose;--3- Checking FRA SpaceSELECT ROUND((A.SPACE_LIMIT / 1024 / 1024 / 1024), 2) AS FLASH_IN_GB, ROUND((A.SPACE_USED / 1024 / 1024 / 1024), 2) AS FLASH_USED_IN_GB, ROUND((A.SPACE_RECLAIMABLE / 1024 / 1024 / 1024), 2) AS FLASH_RECLAIMABLE_GB, SUM(B.PERCENT_SPACE_USED) AS PERCENT_OF_SPACE_USEDFROM V$RECOVERY_FILE_DEST A, V$FLASH_RECOVERY_AREA_USAGE BGROUP BY SPACE_LIMIT, SPACE_USED , SPACE_RECLAIMABLE ;--4- tableSpacesset lines 1000 pages 1000SELECT a.tablespace_name "Tablespace", to_char(a.bytes/(1024*1024), '999,999,999.90') "Size (MB)", to_char(a.bytes/(1024*1024)-b.bytes/(1024*1024), '999,999,999.90') "Used (MB)", to_char(b.bytes/(1024*1024), '999,999,999.90') "Free (MB)",to_char(round(((a.bytes-b.bytes)/a.bytes)*100, 2), '99.90') "% Used" FROM( SELECT tablespace_name, sum(bytes) bytes from dba_data_files group BY tablespace_name) a, (SELECT tablespace_name, sum(bytes) bytes, max(bytes) largest from dba_free_space group BY tablespace_name ) b WHERE a.tablespace_name=b.tablespace_name(+) ORDER BY 5 DESC;---5- TableSpace temporalset lines 3000 pages 5000SELECT a.tablespace_name || '--> TEMPORAL TBS' tablespace_name,b.SIZEMB "Mb Total", a.FREEMB "Mb Free",a.FREEMB/b.SIZEMB*100 "%Free" from(SELECT tablespace_name,trunc(SUM(bytes_free)/1024/2024) FREEMBFROM v$temp_space_headerGROUP BY tablespace_name) a,(SELECT tablespace_name,trunc(SUM(bytes)/1024/1024) SIZEMBFROM dba_temp_filesGROUP BY tablespace_name) bwhere a.tablespace_name=b.tablespace_name;no rows selectedSQL> Session altered.SQL> SQL> SQL> 2 3 4 5 6 7 8 9 10 11 12 FLASH_IN_GB FLASH_USED_IN_GB FLASH_RECLAIMABLE_GB PERCENT_OF_SPACE_USED----------- ---------------- -------------------- --------------------- 4 .16 0 4.02SQL> SQL> SQL> SQL> 2 3 4 5 6 7 8 Tablespace Size (MB) Used (MB) Free (MB) % Used------------------------------ --------------- --------------- --------------- ------SYSTEM 1,500.00 564.81 935.19 37.65SYSAUX 1,500.00 561.56 938.44 37.44USERS 5.00 1.19 3.81 23.75SL_TXN_IDX_TBS 100.00 13.00 87.00 13.00SL_TXN_TBS 100.00 7.69 92.31 7.69SL_SD_IDX_TBS 100.00 3.94 96.06 3.94SL_SD_TBS 100.00 3.06 96.94 3.06UNDOTBS1 490.00 10.56 479.44 2.168 rows selected.SQL> SQL> SQL> SQL> SQL> 2 3 4 5 6 7 8 9 10 11 12 TABLESPACE_NAME Mb Total Mb Free %Free------------------------------------------------- ---------- ---------- ----------TEMP-->? TEMPORAL TBS 214 0 0