Skip to main content

How to check database i/o waits and compare them with CPU

How to check database i/o waits and compare them with CPU

column wait_type format a35 heading "Wait Type"
column lock_name format a12
column waits_1000 format  99,999,999 heading "Waits|\1000"
column time_waited_hours format 99,999.99 heading "Time|Hours"
column pct format 99.99 Heading "Pct"
column avg_wait_ms format 9,999.99 heading "Avg Wait|Ms"
set pagesize 10000
set lines 100
set echo on

WITH system_event AS
    (SELECT CASE
              WHEN wait_class IN ('User I/O', 'System I/O')
              THEN event ELSE wait_class
             END  wait_type, e.*
        FROM v$system_event e)
SELECT wait_type, SUM(total_waits) / 1000 waits_1000,
       ROUND(SUM(time_waited_micro) / 1000000 / 3600, 2)
             time_waited_hours,
       ROUND(SUM(time_waited_micro) / SUM(total_waits) / 1000, 2)
             avg_wait_ms,
       ROUND(  SUM(time_waited_micro)
             * 100
             / SUM(SUM(time_waited_micro)) OVER (), 2)
          pct
FROM (SELECT wait_type, event, total_waits, time_waited_micro
      FROM system_event e
      UNION
      SELECT 'CPU', stat_name, NULL, VALUE
      FROM v$sys_time_model
      WHERE stat_name IN ('background cpu time', 'DB CPU')) l
WHERE wait_type <> 'Idle'
GROUP BY wait_type
ORDER BY SUM(time_waited_micro) DESC
/

                                          Waits       Time  Avg Wait
Wait Type                                 \1000      Hours        Ms    Pct
----------------------------------- ----------- ---------- --------- ------
CPU                                                 318.54            76.46
db file sequential read                 379,029      48.56       .46  11.66
db file parallel write                   29,812      11.04      1.33   2.65
log file parallel write                  61,098      11.03       .65   2.65
Commit                                   50,008      10.12       .73   2.43
Network                              12,120,085       5.46       .00   1.31
control file parallel write              14,511       3.91       .97    .94
db file scattered read                    3,777       3.55      3.38    .85
Application                               1,498       1.34      3.23    .32
Concurrency                                 809        .64      2.83    .15
direct path read                            875        .58      2.40    .14
db file parallel read                       446        .46      3.68    .11
control file sequential read             35,529        .40       .04    .10
read by other session                       336        .34      3.62    .08
log file sequential read                    216        .26      4.29    .06
db file async I/O submit                 25,549        .14       .02    .03
Other                                       982        .06       .24    .02
Log archive I/O                               1        .06    189.48    .01
Disk file operations I/O                  1,961        .04       .07    .01
Administrative                                0        .02    307.80    .01
Data file init write                         11        .01      3.81    .00
direct path write temp                        9        .01      4.01    .00
direct path write                            21        .01      1.58    .00
Configuration                                 5        .01      7.25    .00
direct path read temp                        18        .00       .95    .00
control file single write                     6        .00      2.72    .00
log file single write                         2        .00      2.07    .00
db file single write                          3        .00       .91    .00
recovery read                                 0        .00      8.50    .00
local write wait                              1        .00      1.87    .00
Parameter File I/O                            1        .00      1.17    .00
Scheduler                                     1        .00      1.79    .00
Disk file Mirror/Media Repair Write           0        .00      2.74    .00

33 rows selected.

SQL>

Comments

Last Week Topics

How to Force The Database Open With `_ALLOW_RESETLOGS_CORRUPTION

This is an internal note from Oracle. Forcing The Database Open With `_ALLOW_RESETLOGS_CORRUPTION` with Automatic Undo Management ( Doc ID 283945.1 ) Warning The following instructions should only be used under the explicit direction of Oracle Support. These steps should only be used when all other conventional means of recovering the database have failed. Please note that there is no guarantee that this method will succeed. IF THE STEPS BELOW DO ALLOW YOU TO OPEN YOUR DATABASE THEN IT IS ESSENTIAL THAT THE DATABASE BE REBUILT AS IT IS NO LONGER SUPPORTED. FAILURE TO DO SO MAY LEAD TO DATA DICTIONARY INCONSISTENCIES, INTERNAL ERRORS AND CORRUPTIONS. ** Note: The steps here apply to Oracle 9i or higher and only and when Automatic Undo Management is being used. ** Steps to attempt to force the database open: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1) Backup the database while the database is closed. THE INSTRUCTIONS HERE ARE DESTRUCTIVE. YOU ARE STRONGLY A

HOW TO SHARE SAMBA SHARE FROM WINDOWS TO SOLARIS 11

SHARE WINDOWS FOLDER WITH SAMBA IN SOLARIS 11 OPEN THOSE PORT IF YOU HAVE A FIREWALL BETWEEN SERVERS PORT    STATE SERVICE 135/tcp open  msrpc 139/tcp open  netbios-ssn 445/tcp open  microsoft-ds 137 UDP 138 UDP INSTALL SAMBA PACKAGES #pkg install samba ENABLE EACH SERVICES AFTER INSTALLING SAMBA AND CONFIGURE THE SMB.CONF #svcadm enable idmap #svcadm enable smb/client #svcadm enable samba root@:/# vi /etc/samba/smb.conf [ftps]   path = //april.domaintest/FTPS   realm = april.domaintest.com   netbios name = april   passdb backend = YourSharingPassword   guest account = SAMBAUX   log file = /var/samba/log/%m.log   load printers = No   wins server = YourWinServer    winbind trusted domains only = No   workgroup = domaintest.com   hosts allow = 192.168.1.10    TEST THE CONNECTION WITH WINDOWS SAMBA SERVER SHARE     root@:/#  smbclient -L //april/FTPS/ -s /etc/samba/smb.conf -N Anonymous login successful         Sharename       Ty

HOW TO ENABLE A VIRTUAL INTERFACE (VNIC) SOLARIS 10

HOW TO ENABLE A VIRTUAL INTERFACE (VNIC) SOLARIS 10 1.-Verify the interfaces on the server that you need to add the ip in this example 10.1.1.8 # dladm show-phys LINK CLASS MTU STATE OVER bge0 phys 1500 unknown -- bge1 phys 1500 up --    2.-Now you need to create a virtual network interface or VNIC on the server #ifconfig bge1:1 plumb #ifconfig -a 3.-Finally you can add the new ip address and add on the server in /etc/hostname.bge1:1 the IP or the name that you defined on the hosts file with that ip #vi /etc/hostname.bge1:1 10.1.1.8 #ifconfig bge1:1 10.1.1.8 netmask 255.255.255.0 broadcast 10.1.1.254 up Regards Roger    

HOW TO CHANGE HOSTNAME RED HAT LINUX

HOW TO CHANGE HOSTNAME RED HAT LINUX 1.-Validate Hostname and host file that you need to change #hostname rhel #cat /etc/hosts 127.0.0.1  localhost 192.168.1.13  rhel 2.-Edit the following file in order to change HOSTNAME #vi /etc/sysconfig/network NETWORKING=yes HOSTNAME=TEST GATEWAY=192.168.1.1 3.-When you are ready and you save the information you will need to edit the hosts file #vi /etc/hosts 127.0.0.1  localhost 192.168.1.13  test 4.- Finally you will need to restart de network services #service network restart #hostname test

How to reorganize tables with brspace commands.

Brspace use internally Oracle DBMS_REDEFINITION. If you have SAP with Oracle, this is a very fast way to reorganize object in Oracle Database. In this example we will organize simultaneously S562,MLPPF and MLCRP tables. Important : If you want to reorganize various tables and indexes, these must reside in same tablespace. 1- Tables reorganization. brspace -p /oracle/PRD/102_64/dbs/initPRD.sap -c force -s 20 -l E -f tbreorg -a reorg -s PSAPSR3 -o SAPSR3 -t "S562,MLPPF,MLCRP" -n PSAPSR3 -e 16 -p 16 -m online *  /oracle/PRD/102_64/dbs/initPRD.sap : SAP Parameter file * PSAPSR3 : Source tablespace * SAPSR3  : Table owner * PSAPSR3 :  Destiny tablespace. * -e 16 -p 16 -m :  It indicates how many parallel processes that will perform the operation,in this case are 16. * online : It indicates that the reorganization of the tables will be made ONLINE 2- After tables reorganization you will need to rebuild the S562,MLPPF and MLCRP indexes tables . brspac

How to install Oracle Directory Server 11 Solaris 10

Createl DSCC Registry that is   Directory Server Manager for LDAP server administration root@ldapserv1:/opt/ODSEE_ZIP_Distribution/dsee7/bin# ./dsccsetup ads-create Choose password for Directory Service Manager: Confirm password for Directory Service Manager: Creating DSCC registry... DSCC Registry has been created successfully Deploy the directory server root@ldapserv1:/opt/ODSEE_ZIP_Distribution/dsee7/bin# ./dsccsetup war-file-create Created /opt/ODSEE_ZIP_Distribution/dsee7/var/dscc7.war 1636 /opt/dsInst Choose the Directory Manager password: <Password Directory Manager> Confirm the Directory Manager password: <Password Directory Manager> Starting the instance created with dsadm Use command 'dsadm start '/opt/dsInst'' to start the instance oot@ldapserv1:/opt/ODSEE_ZIP_Distribution/dsee7/bin# ./dsadm start '/opt/dsInst' Directory Server instance '/opt/dsInst' started: pid=19325 Create the suffix   and port that will be used,

How to break a bonded network interface red hat

1.- Bonding device called bond0 which aggregated by eth0 and eth1 # ifconfig bond0     Link encap:Ethernet  HWaddr 44:a8:42:5d:6d:5d           inet addr:192.168.1.51  Bcast:192.168.1.255  Mask:255.255.255.0           inet6 addr: fe80::5054:ff:fe4d:9004/64 Scope:Link           UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1 eth0      Link encap:Ethernet  HWaddr 44:a8:42:5d:6d:5d           UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1 eth2      Link encap:Ethernet  HWaddr 44:a8:42:5d:76:29           UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1           RX packets:6 errors:0 dropped:0 overruns:0 frame:0 # cat /proc/net/bonding/bond0 Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009) Bonding Mode: fault-tolerance (active-backup) Primary Slave: em1 (primary_reselect always) Currently Active Slave: em1 MII Status: up MII Polling Interval (ms): 50 Up Delay (ms): 0 Down Delay (ms): 0 Slave Interface: eth0 MII Status: up Speed: 10000

Solaris 11.3 Bug# 21207532 System or DB hang in zil_commit() at shutdown

The issue is generated due to ZFS bug present in version lower than 11.3.2.4.0, those symptoms produce that some errors related with IO wait are generated in the trace log file of the Oracle Data Base, shutting down the mmon process as you see below Trace log example: Thu Sep 01 08:51:11 2016 WARNING: aiowait timed out 2 times Thu Sep 01 08:57:38 2016 minact-scn: got error during useg scan e:12751 usn:4 minact-scn: useg scan erroring out with error e:12751 Suspending MMON action 'Block Cleanout Optim, Undo Segment Scan' for 82800 seconds Thu Sep 01 09:01:11 2016 WARNING: aiowait timed out 3 times Thu Sep 01 09:07:20 2016 Suspending MMON action 'undo usage' for 82800 seconds Thu Sep 01 09:11:11 2016 WARNING: aiowait timed out 4 times Thu Sep 01 09:12:03 2016 Shutting down instance (immediate) Stopping background process SMCO Thu Sep 01 09:12:34 2016 Background process SMCO not dead after 30 seconds Killing background process SMCO Shutting

HOW TO INSTALL RSYNC SOLARIS 10 FOR SPARC PLATFORMS

HOW TO INSTALL RSYNC 3.1.1 SOLARIS 10 1.-Download the following packages   libintl-3.4.0-sol10-sparc-local.gz rsync.3.1.1.SPARC.32bit.Solaris.10.pkg libiconv.1.14.SPARC.32bit.Solaris.10.pkg   2.-Once you have the packages on the server you can do the following steps   libintl-3.4.0-sol10-sparc-local.gz rsync.3.1.1.SPARC.32bit.Solaris.10.pkg libiconv.1.14.SPARC.32bit.Solaris.10.pkg    3.-  Unzip the packages that are compressed and install them with pkgadd. #gunzip libintl-3.4.0-sol10-sparc-local.gz #pkgadd –d libintl-3.4.0-sol10-sparc-local   #pkgadd –d  rsync.3.1.1.SPARC.32bit.Solaris.10.pkg #pkgadd –d libiconv.1.14.SPARC.32bit.Solaris.10.pkg And now you can use the rsync Regards Roger