tuning
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| tuning [2018/12/06 21:05] – created 91.177.234.129 | tuning [2020/04/04 17:21] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Tuning ====== | + | * [[http:// |
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[http:// | ||
| + | * [[https:// | ||
| + | * [[http:// | ||
| - | * [[http:// | + | * [[http:// |
| - | * [[http:// | + | * [[https://blogs.oracle.com/optimizer/how-do-i-drop-an-existing-histogram-on-a-column-and-stop-the-auto-stats-gathering-job-from-creating-it-in-the-future|How do I drop an existing histogram on a column |
| - | * [[http:// | + | |
| - | * [[http:// | + | |
| - | * [[http:// | + | |
| - | * [[http:// | + | |
| - | * [[https:// | + | |
| - | * [[https://www.youtube.com/watch? | + | |
| - | * [[http:// | + | |
| - | * [[https:// | + | |
| - | * [[http:// | + | |
| - | =====Wait-based tuning query===== | + | |
| - | < | + | |
| - | =====Identifying I/O Problems Using V$ Views===== | + | ==== Wait-based tuning query ==== |
| - | The V$IOSTAT_FILE view captures I/O statistics of database files that are or have been accessed.<br /> | + | < |
| - | The SMALL_SYNC_READ_LATENCY column displays the latency for single block synchronous reads (in milliseconds), | + | set pages 999 |
| - | This defines the responsiveness of the storage subsystem based on the current load.<br /> | + | set lines 190 |
| - | If there is a high latency for critical datafiles, you may want to consider relocating these files to improve their service time.<br /> | + | column c1 heading ' |
| + | column c2 heading ' | ||
| + | column c3 heading ' | ||
| + | column c4 heading ' | ||
| + | column c5 heading ' | ||
| + | ttitle ' | ||
| + | select event c1 | ||
| + | , total_waits | ||
| + | , time_waited / 100 c3 | ||
| + | , total_timeouts | ||
| + | , average_wait | ||
| + | from | ||
| + | where event not in ( | ||
| + | ' | ||
| + | , ' | ||
| + | , ' | ||
| + | , ' | ||
| + | , ' | ||
| + | , ' | ||
| + | , ' | ||
| + | , ' | ||
| + | , ' | ||
| + | , ' | ||
| + | , ' | ||
| + | , ' | ||
| + | , ' | ||
| + | , ' | ||
| + | , ' | ||
| + | , ' | ||
| + | , ' | ||
| + | ) | ||
| + | and event not like ' | ||
| + | and event not like ' | ||
| + | and event not like ' | ||
| + | and event not like ' | ||
| + | order by c2 desc | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | ==== Identifying I/O Problems Using V$ Views ==== | ||
| + | The V$IOSTAT_FILE view captures I/O statistics of database files that are or have been accessed.\\ | ||
| + | The SMALL_SYNC_READ_LATENCY column displays the latency for single block synchronous reads (in milliseconds), | ||
| + | This defines the responsiveness of the storage subsystem based on the current load.\\ | ||
| + | If there is a high latency for critical datafiles, you may want to consider relocating these files to improve their service time.\\ | ||
| To calculate latency statistics, timed_statistics must be set to TRUE. | To calculate latency statistics, timed_statistics must be set to TRUE. | ||
| - | < | + | < |
| + | select file_no | ||
| + | , filetype_id | ||
| + | , filetype_name | ||
| + | , small_read_megabytes | ||
| + | , small_write_megabytes | ||
| + | , large_read_megabytes | ||
| + | , large_write_megabytes | ||
| + | , small_sync_read_latency | ||
| + | from | ||
| + | order by small_sync_read_latency desc | ||
| + | / | ||
| + | </ | ||
| - | =====Show sql statements running at specific times (between 2 snapshot id's)===== | + | ==== Show sql statements running at specific times (between 2 snapshot id's) ==== |
| List is taken from ASH/AWR tables | List is taken from ASH/AWR tables | ||
| - | < | + | < |
| + | col ssnap new_value ssnap_var | ||
| + | col esnap new_value esnap_var | ||
| + | set lines 100 pages 999 | ||
| + | |||
| + | select snap_id, | ||
| + | to_char(begin_interval_time, | ||
| + | from | ||
| + | | ||
| + | order by 1 | ||
| + | / | ||
| + | |||
| + | col SAMPLE_TIME for a18 | ||
| + | col SQL_EXEC_START for a20 | ||
| + | col SESSION_ID for 9999 | ||
| + | col SQL_OPNAME for a15 | ||
| + | col PROGRAM for a10 | ||
| + | col SESSION_SERIAL# | ||
| + | col USERNAME for a20 | ||
| + | set long 999999999 | ||
| + | set lines 500 | ||
| + | set pages 50000 | ||
| + | |||
| + | select '& | ||
| + | |||
| + | DEFINE LOGFILE=Sessions_dmls_detail_&& | ||
| + | |||
| + | spool && | ||
| + | |||
| + | |||
| + | |||
| + | select a.SAMPLE_TIME, | ||
| + | from DBA_HIST_ACTIVE_SESS_HISTORY a, dba_hist_sqltext b, dba_users c | ||
| + | where a.SQL_ID = b.SQL_ID and a.user_id=c.user_id and a.snap_id between && | ||
| + | order by a.SQL_EXEC_START asc; | ||
| + | spool off; | ||
| + | exit | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | === References === | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| - | ====References==== | ||
| - | * [[http:// | ||
| - | * [[http:// | ||
tuning.1544130327.txt.gz · Last modified: 2018/12/06 21:05 by 91.177.234.129
