post-inst.htm
来自「Debian中文参考手册,系统介绍了Debian系统」· HTM 代码 · 共 1,370 行 · 第 1/5 页
HTM
1,370 行
<!--
infolevel=all
infotype=general
--><a id="sthref574" name="sthref574"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Automating Database Startup and Shutdown for Tru64 (Optional)<a id="sthref575" name="sthref575"></a><a id="sthref576" name="sthref576"></a><a id="sthref577" name="sthref577"></a><a id="sthref578" name="sthref578"></a>
</font>
</h3>
<p>This process must be completed for every new database that you want to configure for automated startup and shutdown. Perform the following tasks to start up and shut down listeners and set up the <code>dbstart</code> and <code>dbshut</code> scripts so that they are called at system startup:<a id="sthref579" name="sthref579"></a><a id="sthref580" name="sthref580"></a>
</p>
<ol type="1" start="1">
<li>
<p>Log in as <code>root</code> user.
</p>
</li>
<li>
<p>Edit the <code>/etc/oratab</code> file.
</p>
<p>Database entries in the <code>/etc/oratab</code> file appear 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>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>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>Change directory to <code>/sbin/init.d</code>.
</p>
</li>
<li>
<p>Create a file named <code>oracle</code>, and use <code>chmod</code> to set the privileges to 750.
</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>Note:</strong>
</font>
</p>This script assumes that a password is not set for the listener. If a password is set, the listener will not be stopped.
<p>The ORACLE_HOME and ORACLE variables are examples. Use information as appropriate for your installation.
</p>
</td>
</tr></tbody>
</table><br />
</li>
<li>
<p>Add the following contents to the <code>/sbin/init.d/oracle</code> file:
</p>
<pre>#!/bin/sh
#
# change the value of ORACLE_HOME to be correct for your
# installation
ORACLE_HOME=/opt/oracle/product/9.2.0.1.0
PATH=${PATH}:$ORACLE_HOME/bin
HOST='hostname'
#
# change the value of ORACLE to the login name of the
# oracle owner at your site
#
ORACLE=oracle
export ORACLE_HOME PATH
#
if [ ! "$2" = "ORA_DB" ] ; then
rsh $HOST -l $ORACLE /sbin/init.d/oracle $1 ORA_DB
exit
fi
#
LOG=$ORACLE_HOME/startup.log
touch $LOG
chmod a+r $LOG
#
case $1 in
'start')
echo "$0: starting up" >> $LOG
date >> $LOG
# Start Oracle Net
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
echo "starting Oracle Net listener"
$ORACLE_HOME/bin/lsnrctl start >> $LOG 2>&1 &
fi
echo "starting Oracle databases"
$ORACLE_HOME/bin/dbstart >> $LOG 2>&1
        ;;
'stop')
echo "$0: shutting down" >> $LOG
date >> $LOG
# Stop Oracle Net
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
echo "stopping Oracle Net listener"
$ORACLE_HOME/bin/lsnrctl stop >> $LOG 2>&1
fi
echo "stopping Oracle databases"
$ORACLE_HOME/bin/dbshut >> $LOG 2>&1
        ;;
*)
echo "usage: $0 {start|stop}"
exit
        ;;
esac
#
exit
</pre>
<pre>
</pre>
</li>
<li>
<p>Change the <code>.rhosts</code> file in the <code>oracle</code> user login home directory to allow <code>root</code> login access to the account.
</p>
<pre><em>your_host_name </em>root
</pre>
</li>
<li>
<p>Link files into the startup and shutdown directories by using the<code> 'ln -s' </code>command.
</p>
<pre># ln -s /sbin/init.d/oracle /sbin/rc3.d/S99oracle
# ln -s /sbin/init.d/oracle /sbin/rc0.d/K01oracle
</pre>
<p>This file automatically starts and stops Oracle9<em>i</em><em> </em>when the system is started or stopped.
</p>
</li>
</ol>
</div class="sect2">
</div class="sect1"><a id="i1000666" name="i1000666"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref581" name="sthref581"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">Configuration Tasks to Perform as the oracle User<a id="sthref582" name="sthref582"></a>
</font>
</h2>
<p>Perform the following tasks as the <code>oracle</code> user:
</p>
<ul>
<li type="square">
<p><a href="#i1036583">Updating UNIX Account Startup Files</a>
</p>
</li>
<li type="square">
<p><a href="#i1014168">Setting Environment Variables</a>
</p>
</li>
<li type="square">
<p><a href="#i1039973">Initializing the oraenv Script </a>
</p>
</li>
<li type="square">
<p><a href="#i1029800">Backing Up the root.sh Script</a>
</p>
</li>
<li type="square">
<p><a href="#i1029784">Setting Initialization Parameters</a>
</p>
</li>
</ul><a id="i1036583" name="i1036583"></a>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref583" name="sthref583"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Updating UNIX Account Startup Files
</font>
</h3>
<p>Update the startup files of the <code>oracle</code> user and the UNIX accounts of <code>oracle</code> users.
</p>
</div class="sect2"><a id="i1014168" name="i1014168"></a>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref584" name="sthref584"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Setting Environment Variables
</font>
</h3>
<p><a id="sthref585" name="sthref585"></a><a id="sthref586" name="sthref586"></a><a id="sthref587" name="sthref587"></a><a id="sthref588" name="sthref588"></a><a id="sthref589" name="sthref589"></a>Set the following environment variables in the<code>.profile</code> or<code>.login</code> file of the <code>oracle</code> user before using Oracle9<em>i</em> products. The settings that you use here should correspond to the settings used during installation as described in <a href="pre.htm#i1000790">"Set Environment Variables"</a>. The syntax for setting environment variables is as follows.
</p>
<p>For the Bourne or Korn shell:
</p>
<pre><em>variable_name</em>=<em>value</em>; export <em>variable_name</em>
</pre>
<p>For the C shell:
</p>
<pre>setenv <em>variable_name value</em>
</pre>
<p><a href="#g1057811">Table 4-2</a> describes the Environment Variable Settings.
</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>Caution:</strong>
</font>
</p>Do not define environment variables with names that are identical to those used for Oracle processes such as <code>CKPT</code>, <code>PMON</code>, and <code>DBWR</code>.
</td>
</tr></tbody>
</table><br />
</div><a id="sthref590" name="sthref590"></a><a id="g1057811" name="g1057811"></a>
<p><strong><em><font face="arial, helvetica, sans-serif">Table 4-2 Environment Variable Settings
</font></em></strong></p>
<table title="Environment Variable Settings " summary="This table lists the environment variable settings." dir="ltr" border="1" width="100%" frame="hsides" rules="rows" 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>Environment Variable
</strong></font></th>
<th id="r1c2" align="left" colspan="1" rowspan="1" valign="bottom">
<font face="Arial, Helvetica, sans-serif">
<strong>Recommended Setting
</strong></font></th>
</tr>
</thead><tbody>
<tr align="left" valign="top">
<td id="r2c1" headers="r1c1" align="left" colspan="1" rowspan="1">ORACLE_HOME
</td>
<td headers="r2c1 r1c2" align="left" colspan="1" rowspan="1">Set the ORACLE_HOME variable to specify the directory containing the Oracle software for a particular release. The OFA recommended value is:
<pre><code>$ORACLE_BASE/product</code>/<em>release</em>
</pre>
<p>For example,
</p>
<pre><code>ORACLE_BASE </code>variable is:
<code>/u01/app/oracle</code><code>, then the ORACLE_HOME</code> variable would be:
/u01/app/oracle/product/9.2.0.1.0
</pre>
</td>
</tr>
<tr align="left" valign="top">
<td id="r3c1" headers="r1c1" align="left" colspan="1" rowspan="1">CLASSPATH
</td>
<td headers="r3c1 r1c2" align="left" colspan="1" rowspan="1">Set the CLASSPATH variable to ensure Java functionality. The CLASSPATH variable is different for various products.
<p>CLASSPATH must include the following:
</p>
<pre>$ORACLE_HOME/jlib/<product jar file>:
$ORACLE_HOME/product/jlib/product_jar_file
</pre>
<p><strong>See Also:</strong> Oracle9<em>i</em> Java documentation for more information on setting the CLASSPATH variable.
</p>
</td>
</tr>
<tr align="left" valign="top">
<td id="r4c1" headers="r1c1" align="left" colspan="1" rowspan="1">LD_LIBRARY_PATH
</td>
<td headers="r4c1 r1c2" align="left" colspan="1" rowspan="1">Set the LD_LIBRARY_PATH variable as <code>$ORACLE_HOME/lib</code> for HP, Linux, Tru64, and Solaris 32-bit.
<p>Set the LD_LIBRARY_PATH variable as <br /><code>$ORACLE_HOME/lib</code>32 for Solaris 64-bit.
</p>
</td>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?