📄 ch2_tun.htm
字号:
<li type="disc">
<p>Decrease the number of UNIX file buffers, especially if you are using raw devices.
</p>
</li>
</ul>
<p>To determine how much swap space is in use, enter one of the following commands:
</p>
<table title="Swap Space Commands" summary="This table lists the commands to determine swap space by platform." 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>Platform
</strong></font></th>
<th id="r1c2" align="left" colspan="1" rowspan="1" valign="bottom">
<font face="Arial, Helvetica, sans-serif">
<strong>Command
</strong></font></th>
</tr>
</thead><tbody>
<tr align="left" valign="top">
<td id="r2c1" headers="r1c1" align="left" colspan="1" rowspan="1">AIX
</td>
<td headers="r2c1 r1c2" align="left" colspan="1" rowspan="1"><code>lsps -a</code>
</td>
</tr>
<tr align="left" valign="top">
<td id="r3c1" headers="r1c1" align="left" colspan="1" rowspan="1">HP
</td>
<td headers="r3c1 r1c2" align="left" colspan="1" rowspan="1"><code>swapinfo -m</code>
</td>
</tr>
<tr align="left" valign="top">
<td id="r4c1" headers="r1c1" align="left" colspan="1" rowspan="1">Linux
</td>
<td headers="r4c1 r1c2" align="left" colspan="1" rowspan="1"><code>swapon -s</code>
</td>
</tr>
<tr align="left" valign="top">
<td id="r5c1" headers="r1c1" align="left" colspan="1" rowspan="1">Solaris
</td>
<td headers="r5c1 r1c2" align="left" colspan="1" rowspan="1"><code>swap -l</code>
</td>
</tr>
<tr align="left" valign="top">
<td id="r6c1" headers="r1c1" align="left" colspan="1" rowspan="1">Tru64
</td>
<td headers="r6c1 r1c2" align="left" colspan="1" rowspan="1"><code>swapon -s</code>
</td>
</tr></tbody>
</table>
<p>To add swap space to your system, enter one of the following commands:
</p>
<table title="Adding Swap Space" summary="This table lists the commands used to add swap space, by platform." 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>Platform
</strong></font></th>
<th id="r1c2" align="left" colspan="1" rowspan="1" valign="bottom">
<font face="Arial, Helvetica, sans-serif">
<strong>Command
</strong></font></th>
</tr>
</thead><tbody>
<tr align="left" valign="top">
<td id="r2c1" headers="r1c1" align="left" colspan="1" rowspan="1">AIX
</td>
<td headers="r2c1 r1c2" align="left" colspan="1" rowspan="1"><code>chps</code> or <code>mkps</code>
</td>
</tr>
<tr align="left" valign="top">
<td id="r3c1" headers="r1c1" align="left" colspan="1" rowspan="1">HP
</td>
<td headers="r3c1 r1c2" align="left" colspan="1" rowspan="1"><code>swapon</code>
</td>
</tr>
<tr align="left" valign="top">
<td id="r4c1" headers="r1c1" align="left" colspan="1" rowspan="1">Linux
</td>
<td headers="r4c1 r1c2" align="left" colspan="1" rowspan="1"><code>swapon -a</code>
</td>
</tr>
<tr align="left" valign="top">
<td id="r5c1" headers="r1c1" align="left" colspan="1" rowspan="1">Solaris
</td>
<td headers="r5c1 r1c2" align="left" colspan="1" rowspan="1"><code>swap -a</code>
</td>
</tr>
<tr align="left" valign="top">
<td id="r6c1" headers="r1c1" align="left" colspan="1" rowspan="1">Tru64
</td>
<td headers="r6c1 r1c2" align="left" colspan="1" rowspan="1"><code>swapon -a</code>
</td>
</tr></tbody>
</table>
<p>Set the swap space to between two and four times the system's physical memory. Monitor the use of swap space and increase it as required.
</p>
<div align="center">
<br /><table summary="This is a layout table to format a tip" title="This is a layout table to format a tip" 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>See Also:</strong>
</font>
</p>Your operating system documentation for more information on these commands.
</td>
</tr></tbody>
</table><br />
</div>
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref336" name="sthref336"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Control Paging <a id="sthref337" name="sthref337"></a><a id="sthref338" name="sthref338"></a>
</font>
</h3>
<p>Paging might not present as serious a problem as swapping, because an entire program does not have to be stored in memory to run. A small number of page-outs might not noticeably affect the performance of your system.<a id="sthref339" name="sthref339"></a>
</p>
<p>To detect excessive paging, run measurements during periods of fast response or idle time to compare against measurements from periods of slow response.
</p>
<p>Use the <code>vmstat</code> <a id="sthref340" name="sthref340"></a>or <code>sar</code> comman<a id="sthref341" name="sthref341"></a>d to monitor paging. See the man pages or your operating system documentation for information on interpreting the results for your platform. The following columns from the output of these commands are important on Solaris:
</p>
<table title="vmstat and sar command output columns" summary="This table list important output columns from the vmstat and sar commands." 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>Column
</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>vflt/s</code>
</td>
<td headers="r2c1 r1c2" align="left" colspan="1" rowspan="1">Indicates the number of address translation page faults. Address translation faults occur when a process references a valid page not in memory.
</td>
</tr>
<tr align="left" valign="top">
<td id="r3c1" headers="r1c1" align="left" colspan="1" rowspan="1"><code>rclm/s</code>
</td>
<td headers="r3c1 r1c2" align="left" colspan="1" rowspan="1">Indicates the number of valid pages that have been reclaimed and added to the free list by page-out activity. This value should be zero.
</td>
</tr></tbody>
</table>
<p>If your system consistently has excessive page-out activity<a id="sthref342" name="sthref342"></a>, consider the following solutions:
</p>
<ul>
<li type="disc">
<p>Install more memory.
</p>
</li>
<li type="disc">
<p>Move some of the work to another system.
</p>
</li>
<li type="disc">
<p>Configure the SGA to use less memory.
</p>
</li>
</ul>
</div class="sect2"><a id="i8852" name="i8852"></a>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref343" name="sthref343"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Adjust Oracle Block Size
</font>
</h3>
<p>A UNIX system reads entire operating system blocks from the disk. If the database block size is smaller than the UNIX file system buffer size, I/O bandwidth is inefficient. If you adjust the Oracle database block size to be a multiple of the operating system block size<a id="sthref344" name="sthref344"></a>, you can increase performance by up to five percent.
</p>
<p>The DB_BLOCK_SIZE initialization parameter sets the database block size. You can change the block size by recreating the database.
</p>
<p>To see the current value of the DB_BLOCK_SIZE parameter, enter the SHOW PARAMETERS command in SQL*Plus.
</p>
</div class="sect2">
</div class="sect1"><a id="i23903" name="i23903"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref345" name="sthref345"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">Tuning Disk I/O <a id="sthref346" name="sthref346"></a>
</font>
</h2>
<p>Balance I/O evenly across all available disks to reduce disk access times. For smaller databases and those not using RAID, ensure that different datafiles and tablespaces are distributed across the available disks. <a id="sthref347" name="sthref347"></a><a id="sthref348" name="sthref348"></a><a id="sthref349" name="sthref349"></a>
</p>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref350" name="sthref350"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Choose the Appropriate File System Type<a id="sthref351" name="sthref351"></a><a id="sthref352" name="sthref352"></a>
</font>
</h3>
<p>Depending on the operating system that you use, you can choose from a range of file systems. File systems have different characteristics, and the techniques they use to access data can have a substantial impact on database performance. The following table lists typical file system choices and the platforms on which they are available:
</p>
<table title="File System type" summary="This table describes files systems, by platform." 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>File System
</strong></font></th>
<th id="r1c2" align="left" colspan="1" rowspan="1" valign="bottom">
<font face="Arial, Helvetica, sans-serif">
<strong>Platform
</strong></font></th>
<th id="r1c3" 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">S5
</td>
<td headers="r2c1 r1c2" align="left" colspan="1" rowspan="1">AIX, HP, Solaris
</td>
<td headers="r2c1 r1c3" align="left" colspan="1" rowspan="1"><a id="sthref353" name="sthref353"></a>UNIX System V file system
</td>
</tr>
<tr align="left" valign="top">
<td id="r3c1" headers="r1c1" align="left" colspan="1" rowspan="1">UFS
</td>
<td headers="r3c1 r1c2" align="left" colspan="1" rowspan="1">AIX, HP, Solaris, Tru64
</td>
<td headers="r3c1 r1c3" align="left" colspan="1" rowspan="1"><a id="sthref354" name="sthref354"></a>Unified file system, derived from BSD UNIX
</td>
</tr>
<tr align="left" valign="top">
<td id="r4c1" headers="r1c1" align="left" colspan="1" rowspan="1">VXFS
</td>
<td headers="r4c1 r1c2" align="left" colspan="1" rowspan="1">AIX, Solaris
</td>
<td headers="r4c1 r1c3" align="left" colspan="1" rowspan="1"><a id="sthref355" name="sthref355"></a>Veritas file system
</td>
</tr>
<tr align="left" valign="top">
<td id="r5c1" headers="r1c1" align="left" colspan="1" rowspan="1">Raw
</td>
<td headers="r5c1 r1c2" align="left" colspan="1" rowspan="1">AIX, HP, Linux, Solaris, Tru64
</td>
<td headers="r5c1 r1c3" align="left" colspan="1" rowspan="1">Raw devices/volumes (no file system)
</td>
</tr>
<tr align="left" valign="top">
<td id="r6c1" headers="r1c1" align="left" colspan="1" rowspan="1">EXT2
</td>
<td headers="r6c1 r1c2" align="left" colspan="1" rowspan="1">Linux
</td>
<td headers="r6c1 r1c3" align="left" colspan="1" rowspan="1"><a id="sthref356" name="sthref356"></a>Extended file system for Linux
</td>
</tr>
<tr align="left" valign="top">
<td id="r7c1" headers="r1c1" align="left" colspan="1" rowspan="1">AdvFS
</td>
<td headers="r7c1 r1c2" align="left" colspan="1" rowspan="1">Tru64
</td>
<td headers="r7c1 r1c3" align="left" colspan="1" rowspan="1"><a id="sthref357" name="sthref357"></a>Advanced file system
</td>
</tr>
<tr align="left" valign="top">
<td id="r8c1" headers="r1c1" align="left" colspan="1" rowspan="1">CFS
</td>
<td headers="r8c1 r1c2" align="left" colspan="1" rowspan="1">Tru64
</td>
<td headers="r8c1 r1c3" align="left" colspan="1" rowspan="1"><a id="sthref358" name="sthref358"></a>Cluster file system
</td>
</tr>
<tr align="left" valign="top">
<td id="r9c1" headers="r1c1" align="left" colspan="1" rowspan="1">JFS
</td>
<td headers="r9c1 r1c2" align="left" colspan="1" rowspan="1">AIX
</td>
<td headers="r9c1 r1c3" align="left" colspan="1" rowspan="1">J<a id="sthref359" name="sthref359"></a>ournaled file system
</td>
</tr>
<tr align="left" valign="top">
<td id="r10c1" headers="r1c1" align="left" colspan="1" rowspan="1">JFS2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -