post-inst.htm
来自「Debian中文参考手册,系统介绍了Debian系统」· HTM 代码 · 共 1,370 行 · 第 1/5 页
HTM
1,370 行
</td>
<td headers="r8c1 r1c3" align="left" colspan="1" rowspan="1">The <code>oracle</code> user and ORAINVENTORY group have restricted access to files in the directory. The other users have execute privileges.
</td>
</tr>
<tr align="left" valign="top">
<td id="r9c1" headers="r1c1" align="left" colspan="1" rowspan="1">Product subdirectories such as <code>$ORACLE_HOME/sqlplus</code> <br />or <br /><code>$ORACLE_HOME/rdbms</code>
</td>
<td headers="r9c1 r1c2" align="left" colspan="1" rowspan="1">751
<p><code>rwxr-x--x</code>
</p>
</td>
<td headers="r9c1 r1c3" align="left" colspan="1" rowspan="1">The <code>oracle</code> user and ORAINVENTORY<code> </code>group have restricted access to log files.The other users have execute privileges.
</td>
</tr>
<tr align="left" valign="top">
<td id="r10c1" headers="r1c1" align="left" colspan="1" rowspan="1">Files in <br /><code>$ORACLE_HOME/sqlplus </code>or <br /><code>$ORACLE_HOME/rdbms</code>
</td>
<td headers="r10c1 r1c2" align="left" colspan="1" rowspan="1">644
<p><code>rw-r--r--</code>
</p>
</td>
<td headers="r10c1 r1c3" align="left" colspan="1" rowspan="1">The <code>oracle</code> user should have read and write privileges and the other users should have read-only privileges to these files.
</td>
</tr>
<tr align="left" valign="top">
<td id="r11c1" headers="r1c1" align="left" colspan="1" rowspan="1"><code>$ORACLE_HOME/network /trace</code>
</td>
<td headers="r11c1 r1c2" align="left" colspan="1" rowspan="1">777
<p><code>rwxrwxrwx</code>
</p>
<p>or
</p>
<p>730
</p>
<p><code>rwx-wx---</code>
</p>
</td>
<td headers="r11c1 r1c3" align="left" colspan="1" rowspan="1">The <code>oracle</code> user and members of the ORAINVENTORY group have access to trace files when 730 is used in the production environment. 777 allows broad access to view and create trace files during development.
</td>
</tr>
<tr align="left" valign="top">
<td id="r12c1" headers="r1c1" align="left" colspan="1" rowspan="1">All files under product <code>admin</code> directories, like <br /><code>$</code><code>ORACLE_HOME/rdbms /admin</code> and <br /><code>$ORACLE_HOME/sqlplus /admin</code>
</td>
<td headers="r12c1 r1c2" align="left" colspan="1" rowspan="1">644
<p><code>-rw-r--r--</code>
</p>
</td>
<td headers="r12c1 r1c3" align="left" colspan="1" rowspan="1">SQL scripts should typically be run as the SYS user.
</td>
</tr></tbody>
</table>
</div class="sect2"><a id="i1026404" name="i1026404"></a>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref547" name="sthref547"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Changing Group Membership of the Apache User
</font>
</h3>
<p>After installing the Oracle9<em>i</em> database, the APACHE account access to the <code>oraInventory</code> directory needs to be removed in order to ensure database security. Perform the following tasks:
</p>
<ol type="1" start="1">
<li>
<p>Create a new group to which no other group or user has access.
</p>
</li>
<li>
<p>Assign ownership of this group to Apache.
</p>
</li>
<li>
<p>Change the APACHE account primary Group Identifier (GID) from the one that has ownership of the <code>oraInventory</code> directory (typically ORAINVENTORY) to the new group name.
</p>
</li>
</ol>
</div class="sect2"><a id="i1035370" name="i1035370"></a>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref548" name="sthref548"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Automating Database Startup and Shutdown for HP, Linux and Solaris (Optional)<a id="sthref549" name="sthref549"></a><a id="sthref550" name="sthref550"></a><a id="sthref551" name="sthref551"></a><a id="sthref552" name="sthref552"></a>
</font>
</h3>
<p>Oracle Corporation recommends that you configure your system to automatically start Oracle databases when your system starts up, and to shut down Oracle databases when your system shuts down. Automatic database startup and shutdown protects against improper shutdown of the database.
</p>
<p>The <code>dbstart</code> and <code>dbshut</code> scripts are located in the <code>$ORACLE_HOME/bin</code> directory and can be used to automate database startup and shutdown. <a id="sthref553" name="sthref553"></a><a id="sthref554" name="sthref554"></a><a id="sthref555" name="sthref555"></a><a id="sthref556" name="sthref556"></a><a id="sthref557" name="sthref557"></a><a id="sthref558" name="sthref558"></a><a id="sthref559" name="sthref559"></a><a id="sthref560" name="sthref560"></a>The <code>dbstart</code> and <code>dbshut</code> scripts reference the same entries in the <code>oratab</code> file, so the scripts must apply to the same set of databases. For example, you cannot have the <code>dbstart</code> script automatically start up databases <code>sid1</code>, <code>sid2</code>, and <code>sid3</code>, and the <code>dbshut</code> script shut down only databases <code>sid1</code> and <code>sid2</code>. You can, however, specify that the <code>dbshut</code> script shut down a set of databases while the <code>dbstart</code> script is not used at all. To do this, include a <code>dbshut</code> entry in the system shutdown file but omit the <code>dbstart</code> entry from the system startup files.
</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><code>init</code> command in your UNIX system documentation for more information on system startup and shutdown procedures.
</td>
</tr></tbody>
</table><br />
</div>
<p>Perform the following tasks to set up the <code>dbstart</code> and <code>dbshut</code> scripts so that they are called at system startup. This process must be completed for every new database that you want to configure for automated startup and shutdown.<a id="sthref561" name="sthref561"></a><a id="sthref562" name="sthref562"></a>
</p>
<ol type="1" start="1">
<li>
<p><a id="sthref563" name="sthref563"></a><a id="sthref564" name="sthref564"></a>Edit the <code>/var/opt/oracle/oratab</code> file for Solaris and <code>/etc/oratab</code> file for HP and Linux.
</p>
<p>Database entries in the <code>oratab</code> file appears in the following format:
</p>
<pre><em>ORACLE_SID:ORACLE_HOME:{Y|N}</em>
</pre>
<pre>
</pre>
<p>In the preceding command, Y or N specifies whether you want the <code>dbstart</code> and <code>dbshut</code> scripts to start up and shut down the database. For each database that you want to start up, find the <em><code>ORACLE_SID</code></em> entry identified by the <em><code>sid</code></em> in the first field. Change the last field for each to Y.
</p>
<p>For Oracle Real Application Clusters installation, this entry appears in the following format:
</p>
<pre><em>DB_NAME:ORACLE_HOME:{Y|N}</em>
</pre>
<p>In the preceding command, <em>DB_NAME</em> is the cluster database name. Y or N specifies whether you want the <code>dbstart</code> and <code>dbshut</code> scripts to start up and shut down the database.
</p>
</li>
<li>
<p><a id="sthref565" name="sthref565"></a><a id="sthref566" name="sthref566"></a>In the <code>/etc/init.d</code> directory, create a <code>dbora</code> script similar to the following, if it does not already exist. Be sure to give the full path of the <code>dbstart</code> utility.
</p>
<pre>#!/bin/sh
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/u01/app/oracle/product/9.2.0.1.0
ORA_OWNER=oracle
if [! -f $ORA_HOME/bin/dbstart]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart &
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut &
;;
esac
</pre>
</li>
<li>
<p>Create symbolic links to the <code>dbora</code> script in the appropriate run-level script directories, as follows:
</p>
<pre># ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora
# ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
</pre>
</li>
</ol>
</div class="sect2"><a id="i1035384" name="i1035384"></a>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref567" name="sthref567"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Automating Database Startup and Shutdown for AIX (Optional)<a id="sthref568" name="sthref568"></a><a id="sthref569" name="sthref569"></a><a id="sthref570" name="sthref570"></a><a id="sthref571" name="sthref571"></a>
</font>
</h3>
<p>Oracle Corporation recommends that you configure your system to automatically start Oracle databases when your system starts up, and to shut down Oracle databases when your system shuts down. Automatic database startup and shutdown protects against improper shutdown of the database.
</p>
<dl>
<dt>
<font size="-1" face="arial, helvetica, sans-serif">
<strong>Automating Database Startup
</strong>
</font>
</dt>
<p>Perform the following tasks to set up the <code>dbstart</code> and <code>dbshut</code> scripts so that they are called at system startup. This process must be completed for every new database that you want to configure for automated startup:<a id="sthref572" name="sthref572"></a><a id="sthref573" name="sthref573"></a>
</p>
</dl>
<ol type="1" start="1">
<li>
<p>Edit the <code>/etc/oratab</code> file.
</p>
<p>Database entries in the <code>oratab</code> file appears in the following format:
</p>
<pre><em>ORACLE_SID:ORACLE_HOME:{Y|N}</em>
</pre>
<p>In the preceding command, Y or N specifies whether you want the <code>dbstart</code> and <code>dbshut</code> scripts to start up and shut down the database.
</p>
<p>For Oracle Real Application Clusters installation, this entry appears in the following format:
</p>
<pre><em>DB_NAME:ORACLE_HOME:{Y|N}</em>
</pre>
<p>In the preceding command, <em><code>DB_NAME</code></em> is the cluster database name. Y or N specifies whether you want the <code>dbstart</code> and <code>dbshut</code> scripts to start up and shut down the database.
</p>
</li>
<li>
<p>For each database that you want to start up, find the <em>ORACLE_SID</em><code> </code>entry identified by the <em><code>sid</code></em> in the first field. Change the last field for each to Y.
</p>
</li>
<li>
<p>Add the <code>dbstart</code> script to the <code>/etc/inittab</code> file:
</p>
<pre># mkitab "<em>oradb</em>:2:wait:/bin/su <em>oradb</em> -c|/$ORACLE_HOMES/bin/dbstart"
</pre>
<p>In the preceding command, <em><code>oradb</code></em> is the identifier of the <code>oracle</code> user for which you want to start the database.
</p>
</li>
</ol>
<dl>
<dt>
<font size="-1" face="arial, helvetica, sans-serif">
<strong>Automating Database Shutdown
</strong>
</font>
</dt>
<p>Automate database and system shutdown by creating a script, <code>shut</code>, to start <code>dbshut</code> and the system executable <code>/etc/shutdown</code>. Complete the following steps to create the script:
</p>
</dl>
<ol type="1" start="1">
<li>
<p>If you have not already done so, edit the database entries of your <code>/etc/oratab</code> file to enable <code>dbstart</code> and <code>dbshut</code>, as described in step 1 of the <code>dbstart</code> instructions.
</p>
</li>
<li>
<p>As <code>root</code>, create the <code>shut</code> shell script:
</p>
<pre># cd /etc
cat > shut << EOF
? su <em>oracle_owner</em> -c /usr/oracle/bin/dbshut
? /etc/shutdown $* \
? [Ctrl-D]
# chmod u+x shut
</pre>
</li>
<li>
<p>Execute the following command to run the <code>shut</code> script and shut down the database:
</p>
<pre># /etc/shut -h now
</pre>
</li>
</ol>
<p>This closes Oracle databases and shuts down the system with the specified options.
</p>
</div class="sect2"><a id="i1037836" name="i1037836"></a>
<div class="sect2">
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?