ch2_tun.htm
来自「Debian中文参考手册,系统介绍了Debian系统」· HTM 代码 · 共 1,480 行 · 第 1/5 页
HTM
1,480 行
</td>
<td headers="r10c1 r1c2" align="left" colspan="1" rowspan="1">AIX 5.1
</td>
<td headers="r10c1 r1c3" align="left" colspan="1" rowspan="1">Journaled file system
</td>
</tr></tbody>
</table>
<p>The suitability of a file system to an application is usually undocumented. For example, even different implementations of the Unified file system are hard to compare. Performance differences may vary from 0 to 20 percent, depending on the file system you choose.
</p>
<p>If you choose to use a file system:
</p>
<ul>
<li type="disc">
<p>Make a new file system partition to ensure that the hard disk is clean and unfragmented.
</p>
</li>
<li type="disc">
<p>Perform a file system check on the partition before using it for database files.
</p>
</li>
<li type="disc">
<p>Distribute disk I/O as evenly as possible.
</p>
</li>
<li type="disc">
<p>Separate log files from database files.
</p>
</li>
</ul>
</div class="sect2">
</div class="sect1"><a id="i10932" name="i10932"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref360" name="sthref360"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">Monitoring Disk Performance<a id="sthref361" name="sthref361"></a>
</font>
</h2>
<p>To monitor disk performance, use the <code>sar</code> <code>-b</code> and <code>sar</code> <code>-u</code> commands.
</p>
<p><a href="#g28081">Table 2-1</a> describes the columns of the <code>sar -b</code> command output that are significant for analyzing disk performance.
</p><a id="sthref362" name="sthref362"></a><a id="g28081" name="g28081"></a>
<p><strong><em><font face="arial, helvetica, sans-serif">Table 2-1 sar -b Output Columns
</font></em></strong></p>
<table title="sar -b Output Columns" summary="This table describes the columns of the sar -b command output that are significant for analyzing disk performance." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
<thead>
<tr align="left" valign="top">
<th id="r1c1" align="left" colspan="1" rowspan="1" valign="bottom">
<font face="Arial, Helvetica, sans-serif">
<strong>Columns
</strong></font></th>
<th id="r1c2" align="left" colspan="1" rowspan="1" valign="bottom">
<font face="Arial, Helvetica, sans-serif">
<strong>Description
</strong></font></th>
</tr>
</thead><tbody>
<tr align="left" valign="top">
<td id="r2c1" headers="r1c1" align="left" colspan="1" rowspan="1"><code>bread/s,</code> <code>bwrit/s</code>
</td>
<td headers="r2c1 r1c2" align="left" colspan="1" rowspan="1">Blocks read and blocks written per second (important for file system databases)
</td>
</tr>
<tr align="left" valign="top">
<td id="r3c1" headers="r1c1" align="left" colspan="1" rowspan="1"><code>pread/s,</code> <code>pwrit/s</code>
</td>
<td headers="r3c1 r1c2" align="left" colspan="1" rowspan="1">Partitions read and partitions written per second (important for raw partition database systems)
</td>
</tr></tbody>
</table>
<p>An important <code>sar -u</code> column for analyzing disk performance is <code>%wio</code>, the percentage of CPU time waiting on blocked I/O.
</p>
<div align="center">
<br /><table summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"><tbody>
<tr>
<td align="left" colspan="1" rowspan="1">
<p>
<font face="arial, helvetica, sans-serif">
<strong>Note:</strong>
</font>
</p>Not all Linux distributions display the <code>%wio</code> column in the output of the <code>sar -u</code> command.
</td>
</tr></tbody>
</table><br />
</div>
<p>Key indicators are:
</p>
<ul>
<li type="disc">
<p>The sum of the <code>bread</code>, <code>bwrit</code>, <code>pread</code>, and <code>pwrit</code> columns indicates the level of activity of the disk I/O subsystem. The higher the sum, the busier the I/O subsystem. The larger the number of physical drives, the higher the sum threshold number can be. A good default value is no more than 40 for two drives and no more than 60 for four to eight drives.
</p>
</li>
<li type="disc">
<p>The<strong> </strong><code>%rcache</code> column value should be greater than 90 and the <code>%wcache</code> column value should be greater than 60. Otherwise, the system may be disk I/O bound.
</p>
</li>
<li type="disc">
<p>If the <code>%wio</code> column value is consistently greater than 20, the system is I/O bound.
</p>
</li>
</ul>
</div class="sect1"><a id="i25471" name="i25471"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref363" name="sthref363"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">Tuning UNIX Kernel Parameters<a id="sthref364" name="sthref364"></a><a id="sthref365" name="sthref365"></a>
</font>
</h2>
<p>You can improve performance by keeping all Oracle users and processes at the same priority. The UNIX kernel typically pre-allocates physical memory, leaving less memory available for other processes such as the Oracle processes.
</p>
<p>Traditionally, kernel parameters such as NBUF, NFILE, and NOFILES were used to adjust kernel size. However, most UNIX implementations dynamically adjust those parameters at run time, even though they are present in the UNIX configuration file.
</p>
<div align="center">
<br /><table summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"><tbody>
<tr>
<td align="left" colspan="1" rowspan="1">
<p>
<font face="arial, helvetica, sans-serif">
<strong>Note:</strong>
</font>
</p>Remember to make a backup copy of your UNIX kernel. See your operating system documentation for information on making a backup copy.
</td>
</tr></tbody>
</table><br />
</div>
</div class="sect1"><a id="i23890" name="i23890"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref366" name="sthref366"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">Tuning the Operating System Buffer Cache<a id="sthref367" name="sthref367"></a><a id="sthref368" name="sthref368"></a><a id="sthref369" name="sthref369"></a>
</font>
</h2>
<p>To take full advantage of raw devices, adjust the size of the Oracle9<em>i</em> buffer cache and, if memory is limited, the operating system buffer cache.<a id="sthref370" name="sthref370"></a><a id="sthref371" name="sthref371"></a><a id="sthref372" name="sthref372"></a>
</p>
<p>The operating system buffer cache holds blocks of data in memory while they are being transferred from memory to disk, or from disk to memory.
</p>
<p>The Oracle9<em>i</em> buffer cache is the area in memory that stores the Oracle database buffers. Because Oracle9<em>i</em> can use raw devices, it does not need to use the operating system buffer cache.
</p>
<p>If you use raw devices, increase the size of the Oracle9<em>i</em> buffer cache. If the amount of memory on the system is limited, make a corresponding decrease in the operating system buffer cache size.
</p>
<p>Use the <code>sar</code> command to determine which buffer caches you must increase or decrease. For more information on the <code>sar</code> command, see the UNIX man pages.
</p>
</div class="sect1"><a id="i21051" name="i21051"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref373" name="sthref373"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">Using Raw Devices/Volumes <a id="sthref374" name="sthref374"></a>
</font>
</h2>
<p>The following sections provide information on using raw devices/volumes.
</p>
<div align="center">
<br /><table summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"><tbody>
<tr>
<td align="left" colspan="1" rowspan="1">
<p>
<font face="arial, helvetica, sans-serif">
<strong>Note:</strong>
</font>
</p>For additional raw device/volume tuning information, see the following appendices:
<ul>
<li type="disc">
<p><a href="appa_aix.htm#g640701">Appendix A, " Tuning for Oracle9<em>i</em> on AIX"</a>
</p>
</li>
<li type="disc">
<p><a href="appc_ln.htm#CHDJHICE">Appendix C, " Tuning for Oracle9<em>i</em> on Linux"</a>
</p>
</li>
<li type="disc">
<p><a href="appd_tru.htm#g644272">Appendix D, " Tuning for Oracle9<em>i</em> on Tru64 "</a>
</p>
</li>
</ul>
</td>
</tr></tbody>
</table><br />
</div><a id="i17319" name="i17319"></a>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref375" name="sthref375"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Guidelines for Using Raw Devices/Volumes<a id="sthref376" name="sthref376"></a><a id="sthref377" name="sthref377"></a>
</font>
</h3><a id="i18427" name="i18427"></a>
<p>Raw devices/volumes have the following disadvantages when used on UNIX:
</p>
<ul>
<li type="disc">
<p>Raw devices/volumes may not solve problems with file size writing limits.
</p>
<br /><table summary="This is a layout table to format a note" title="This is a layout table to format a note" dir="ltr" border="1" width="80%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"><tbody>
<tr>
<td align="left" colspan="1" rowspan="1">
<p>
<font face="arial, helvetica, sans-serif">
<strong><strong>Note</strong>:</strong>
</font>
</p>To display current file size limits, enter the following command:
<p><code>$ ulimit -a</code>
</p>
</td>
</tr></tbody>
</table><br />
</li>
<li type="disc">
<p>Small client systems might not be able to use sufficiently large raw device/volume partitions.
</p>
</li>
<li type="disc">
<p>If a particular disk drive has intense I/O activity and performance would benefit from movement of an Oracle datafile to another drive, it is likely that no acceptably sized section exists on a drive with less I/O activity. It might not be possible to move files to other disk drives if you are using raw devices/volumes.
</p>
</li>
<li type="disc">
<p>Raw devices/volumes may be more difficult to administer than datafiles stored on a file system.
</p>
</li>
</ul>
<p>In addition to the factors described in this section, consider the following issues when deciding whether to use raw devices/volumes:
</p>
<ul>
<li type="disc">
<p>Oracle9<em>i</em> Real Application Clusters installation <a id="sthref378" name="sthref378"></a><a id="sthref379" name="sthref379"></a><a id="sthref380" name="sthref380"></a>
</p>
<p>Each instance of Oracle9<em>i</em> Real Application Clusters has it's own log files. Therefore, in addition to the partitions required for the tablespaces and control files, each instance requires a minimum of three partitions for the log files. All the files must be on disks that can be shared by all nodes of a cluster.
</p>
</li><a id="i17340" name="i17340"></a>
<li type="disc">
<p>Raw disk partition availability <a id="sthref381" name="sthref381"></a>
</p>
<p>Use raw devices/volumes for Oracle files only if your site has at least as many raw disk partitions as Oracle datafiles. If disk space is a consideration and the raw disk partitions are already formatted, match datafile size to partition size as closely as possible to avoid wasting space.
</p>
<p>You must also consider the performance implications of using all of the disk space on a few disks as opposed to using less space on more disks.
</p>
</li><a id="i19533" name="i19533"></a>
<li type="disc">
<p>Logical volume manager
</p>
<p>The logical volume manager manages disk space at a logical level and hides some of the complexity of raw devices. With logical volumes, you can create logical disks based on raw partition availability. The logical volume manager controls fixed-disk resources by:
</p>
<ul>
<li type="circle">
<p>Mapping data between logical and physical storage
</p>
</li>
<li type="circle">
<p>Allowing data to span multiple disks and to be discontiguous, replicated, and dynamically expanded
</p>
</li>
</ul>
</li><a id="i25726" name="i25726"></a>
<li type="disc">
<p>Dynamic performance tuning
</p>
<p>You can optimize disk performance when the database is online by moving files from disk drives with high activity to disk drives with less activity. Most hardware vendors who provide the logical disk facility also provide a graphical user interface you can use for tuning.
</p>
</li><a id="i17357" name="i17357"></a>
<li type="disc">
<p>Mirroring and online disk replacement
</p>
<p>You can mirror logical volumes to protect against loss of data. If one copy of a mirror fails, dynamic resynchronization is possible. Some vendors also provide the ability to replace drives online in conjunction with the mirroring facility.
</p>
<p>For Oracle9<em>i</em> Real Application Clusters, you can use logical volumes for drives associated with a single UNIX system, as well as those that can be shared with more than one computer of a UNIX cluster. Shared drives allow for all files associated with the Oracle9<em>i</em> Real Application Clusters to be placed on these shared logical volumes.
</p>
</li>
</ul>
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref382" name="sthref382"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
<a id="sthref383" name="sthref383"></a>Raw Device Setup
</font>
</h3>
<p>Keep the following items in mind when creating raw devices:
</p>
<ul>
<li type="disc">
<p>When creating the volumes, ensure that the owner is <code>oracle</code> and the
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?