⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch3_sql.htm

📁 Debian中文参考手册,系统介绍了Debian系统
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<pre>&#036; htpasswd &#036;ORACLE&#095;HOME&#047;sqlplus&#047;admin&#047;<em>filename</em>.pw <em>username</em>

</pre>
<p>In the previous examples, <em><code>filename</code></em><code>.pw</code> is the name of the password file that you want to modify or create, and <em><code>username</code></em> is the username that you want to add. The filename of the privileged user password file is <code>iplusdba.pw</code>. For unprivileged users, Oracle Corporation recommends that you use the name <code>iplus.pw</code> for the password file.
</p>
</li>
</ul>
</li>
<li>
<p>When prompted, enter the password for the username you specified.
</p>
</li>
<li>
<p>If you created a new password file, see the following section for information on how to configure Oracle HTTP Server to use it.
</p>
</li>
</ol>
</div class="sect3">
<div class="sect3"><a id="sthref428" name="sthref428"></a>
<h4>
<font face="arial, helvetica, sans-serif" color="#330099">
Configuring the Oracle HTTP Server to Use a New Password File
</font>
</h4>
<p>When you create a new password file for normal users, you must configure the Oracle HTTP Server to use this password file to authenticate users that access the iSQL&#042;Plus URL. To configure the Oracle HTTP Server to use the new password file:
</p>
<ol type="1" start="1">
<li>
<p>Log into the system running the Oracle HTTP Server as the Oracle software owner (oracle).
</p>
</li>
<li>
<p>Change directory to the &#036;ORACLE&#095;HOME&#047;sqlplus&#047;admin directory:
</p>
<pre>&#036; cd &#036;ORACLE&#095;HOME&#047;sqlplus&#047;admin

</pre>
</li>
<li>
<p>Open the isqlplus.conf configuration file in any text editor.
</p>
</li>
<li>
<p>Locate the following section in the file:
</p>
<pre>&#035;&#035; Enable handling of all virtual paths beginning with "&#047;isqlplus"&#035;&lt;Location &#047;isqlplus&gt;  SetHandler fastcgi-script  Order deny,allow  &#035; Comment "Allow ..." and uncomment the four lines "AuthType ..."  &#035; to "Require ..." if Oracle HTTP authentication access is required  &#035; for the http:&#047;&#047;...&#047;isqlplus URL  Allow from all  &#035;AuthType Basic  &#035;AuthName &#039;iSQL&#042;Plus&#039;  &#035;AuthUserFile <em><code>ORACLE&#095;HOME</code></em>&#047;sqlplus&#047;admin&#047;iplus.pw  &#035;Require valid-user&lt;&#047;Location&gt;

</pre>
<p>In this example, <em><code>ORACLE&#095;HOME</code></em> is the path of the Oracle home directory
</p>
</li>
<li>
<p>Modify this section as shown in the following example:
</p>
<pre>&#035;&#035; Enable handling of all virtual paths beginning with "&#047;isqlplus"&#035;&lt;Location &#047;isqlplus&gt; SetHandler fastcgi-script Order deny,allow AuthType Basic AuthName &#039;iSQL&#042;Plus&#039; AuthUserFile <em>ORACLE&#095;HOME</em>&#047;sqlplus&#047;admin&#047;<em>filename</em>.pw Require valid-user&lt;&#047;Location&gt;

</pre>
<p>In this example, <em><code>ORACLE&#095;HOME</code></em> is the path of the Oracle home directory and <em><code>filename</code></em><code>.pw</code> is the name of the password file that you created for normal users (typically <code>iplus.pw</code>).
</p>
</li>
<li>
<p>Verify the changes by parsing the Oracle HTTP Server configuration file:
</p>
<pre>&#036; &#036;ORACLE&#095;HOME&#047;Apache&#047;Apache&#047;bin&#047;apachectl configtest

</pre>
<p>If necessary, fix any errors displayed by this command.
</p>
</li>
<li>
<p>Restart the Oracle HTTP Server:
</p>
<pre>&#036; &#036;ORACLE&#095;HOME&#047;Apache&#047;Apache&#047;bin&#047;apachectl restart

</pre>
<p>After the Oracle HTTP Server restarts, users accessing the iSQL&#042;Plus URL are prompted for the Oracle HTTP Server authentication username and password before the browser displays the login screen.
</p>
</li>
</ol>
</div class="sect3">
<div class="sect3"><a id="sthref429" name="sthref429"></a>
<h4>
<font face="arial, helvetica, sans-serif" color="#330099">
Restricting Database Access from <em>i</em>SQL&#042;Plus
</font>
</h4>
<p>You can restrict access to databases from <em>i</em>SQL&#042;Plus. When restricted database access is enabled, a drop-down list of available databases is displayed in place of the Connection Identifier text field on the Login screen. This allows greater security for <em>i</em>SQL&#042;Plus servers in hosted environments. Connection identifiers are listed in the order defined in the <code>iSQLPlusConnectIdList</code> parameter. 
</p>
<p>You can edit the <code>isqlplus.conf</code> file to enforce restricted database access by changing the following line, where <em><code>SID1, SID2, ...</code></em> is a comma separated list of Oracle Net connection identifiers specifying permitted databases:
</p>
<pre>FastCgiServer ... -initial-env "iSQLPlusConnectIdList&#061;<em>SID1, SID2,...</em>"

</pre>
<p>For example:
</p>
<pre>FastCgiServer ... -initial-env "iSQLPlusConnectIdList&#061;ABC1, PROD2, DEV3"

</pre>
<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>"Editing the iSQL&#042;Plus Configuration File" on page&#160;3&#045;7 for information on editing the <code>isqlplus.conf</code> file.
</td>
</tr></tbody>
</table><br />
<p>While no quotes or embedded whitespace is allowed in a connection identifier, quotes are required around the entire <code>iSQLPlusConnectIdList&#061;</code> argument, as shown in the preceding example. Connection identifiers are not case sensitive, and each connection identifier listed in the argument should be identical to an alias defined in the <code>tnsnames.ora</code> file. 
</p>
<p>Once set, all connections made through the Login screen, all Dynamic Reports and any connections attempted with the CONNECT command are refused unless the connection is to one of the databases specified in the restricted list. Similarly, if you use the SET INSTANCE system variable, the connection identifier defined must match an entry in the <code>iSQLPlusConnectIdList</code> parameter or the connection is refused. If no connection identifier is given, or if the one given does not match an entry in the <code>iSQLPlusConnectIdList</code> parameter, the database connection is refused and the following error occurs:
</p>
<pre>SP2-0884: Connection to database <em>database&#095;name</em> is not allowed

</pre>
<p>In the preceding example, <em><code>database&#095;name</code></em> is the name of the database that you are trying to connect to.
</p>
</div class="sect3">
</div class="sect2">
</div class="sect1"><a id="i2833" name="i2833"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref430" name="sthref430"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">Using Command-Line SQL&#042;Plus<a id="sthref431" name="sthref431"></a><a id="sthref432" name="sthref432"></a>
</font>
</h2>
<p>This section describes how to use command-line SQL&#042;Plus on UNIX systems.
</p>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref433" name="sthref433"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Using a System Editor from SQL&#042;Plus<a id="sthref434" name="sthref434"></a><a id="sthref435" name="sthref435"></a><a id="sthref436" name="sthref436"></a>
</font>
</h3>
<p>If you enter an ED or EDIT command at the SQL&#042;Plus prompt, the system starts an operating system editor, such as <code>ed,</code> <code>emacs,</code> <code>ned</code>, or <code>vi</code>. The PATH variable must include the directory where the editor executable is located.<a id="sthref437" name="sthref437"></a>
</p>
<p>When you start the editor, the current SQL buffer is placed in the editor. When you exit the editor, the changed SQL buffer is returned to SQL&#042;Plus.
</p>
<p>You can specify which editor starts by defining the SQL&#042;Plus &#095;EDITOR variable. You can define this variable in the <code>glogin.sql</code> site profile, the <code>login.sql</code> user profile, or define it during the SQL&#042;Plus session. For example, to set the default editor to <code>vi</code>, enter:
</p>
<pre>SQL&gt; DEFINE &#095;EDITOR&#061;vi

</pre>
<p>If you do not set the<em> </em>&#095;EDITOR variable, the value of either the EDITOR or the VISUAL environment variable is used. If both environment variables are set, the value of the EDITOR variable is used. When &#095;EDITOR, EDITOR, and VISUAL are not specified, the default editor is <code>ed</code>.
</p>
<p>If you start the editor, SQL&#042;Plus uses the <code>afiedt.buf</code> temporary file to pass text to the editor. You can use the SET EDITFILE command to specify a different filename. For example, enter:
</p>
<pre>SQL&gt; SET EDITFILE &#047;tmp&#047;myfile.sql

</pre>
<p>SQL&#042;Plus does not delete the temporary file.
</p>
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref438" name="sthref438"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Running Operating System Commands from SQL&#042;Plus<a id="sthref439" name="sthref439"></a><a id="sthref440" name="sthref440"></a>
</font>
</h3>
<p>Using the HOST command or an exclamation mark (!) as the first character after the SQL&#042;Plus prompt causes subsequent characters to be passed to a sub-shell. The SHELL environment variable sets the shell used to execute operating system commands. The default shell is the Bourne shell (<code>&#047;bin&#047;sh</code>). If the shell cannot be executed, an error message is displayed. 
</p>
<p>To return to SQL&#042;Plus, enter the <code>exit</code> command or press Ctrl&#043;d.
</p>
<p>For example, to execute one command, enter:
</p>
<pre>SQL&gt;! <em><code>command</code></em>

</pre>
<p>In the preceding example, <em><code>command</code></em> &#160;represents the operating system command that you want to execute. 
</p>
<p>To execute multiple operating system commands from SQL&#042;Plus, enter the HOST or ! command then press Return. SQL&#042;Plus returns you to the operating system prompt.
</p>
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref441" name="sthref441"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Interrupting SQL&#042;Plus<a id="sthref442" name="sthref442"></a><a id="sthref443" name="sthref443"></a>
</font>
</h3>
<p>While running SQL&#042;Plus, you can stop the scrolling record display and terminate a SQL statement by pressing Ctrl&#043;c. <a id="sthref444" name="sthref444"></a>
</p>
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref445" name="sthref445"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Using the SPOOL Command<a id="sthref446" name="sthref446"></a><a id="sthref447" name="sthref447"></a>
</font>
</h3>
<p>The default file extension of files generated by the SPOOL command is&#160;.<code>lst</code>. To change this extension, specify a spool file containing a period (.). For example, enter:<a id="sthref448" name="sthref448"></a>
</p>
<pre>SQL&gt; SPOOL query.txt
</pre>
</div class="sect2">
</div class="sect1"><a id="i9455" name="i9455"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref449" name="sthref449"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">SQL&#042;Plus Restrictions<a id="sthref450" name="sthref450"></a><a id="sthref451" name="sthref451"></a>
</font>
</h2>
<p>This section describes SQL&#042;Plus restrictions.
</p>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref452" name="sthref452"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Resizing Windows<a id="sthref453" name="sthref453"></a>
</font>
</h3>
<p>The default values for the SQL&#042;Plus LINESIZE and PAGESIZE system variables do not automatically adjust for window size.
</p>
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref454" name="sthref454"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Return Codes<a id="sthref455" name="sthref455"></a>
</font>
</h3>
<p>UNIX return codes use only one byte, which is not enough space to return an Oracle error code. The range for a return code is 0 to 255.
</p>
</div class="sect2">
<div class="sect2"><a id="sthref456" name="sthref456"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Hiding Your Password
</font>
</h3>
<p>If you set the SYSTEM&#095;PASS environment variable to the username and password of the SYSTEM user, the output from the <code>ps</code> command might display this information. To prevent unauthorized access, enter the SYSTEM password only when prompted by SQL&#042;Plus.
</p>
<p>If you want to automatically run a script, consider using an authentication method that does not require you to store a password, for example, externally authenticated logins to Oracle9<em>i</em>. If you have a low security environment, you might consider using UNIX pipes in script files to pass a password to SQL&#042;Plus, for example:
</p>
<pre>&#036; echo <em>SYSTEM&#095;PASSWORD</em> &#124; sqlplus SYSTEM &#064;MYSCRIPT

</pre>
<p>Alternatively, enter the following lines at the command prompt:
</p>
<pre>&#036; sqlplus &lt;&lt;EOFSYSTEM&#047;<em>SYSTEM&#095;PASSWORD</em>
SELECT ...EXITEOF

</pre>
<p>In the preceding examples, <em><code>SYSTEM&#095;PASSWORD</code></em> is the password of the SYSTEM user.
</p>
<pre>
</pre>
</div class="sect2">
</div class="sect1">
</p>
</div>
<!-- Start Footer -->
<div>
<hr />
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<td valign="bottom" width="33%">
<table cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<a href="ch2_tun.htm">
<img src="../Support/gifs/larrow.gif" alt="Previous" border="0" height="30" width="30"></a>
</td>
<td align="center">
<a href="ch4_comp.htm">
<img src="../Support/gifs/rarrow.gif" alt="Next" border="0" height="30" width="30"></a>
</td>
</tr>
</table>
</td>
<td align="center" width="34%">
<a href="../Support/html/cpyr.htm">
<img src="../Support/gifs/oracle.gif" alt="Oracle Logo" border="0"><br />
<font size="-2">Copyright&nbsp;&copy;&nbsp;1996, 2002&nbsp;Oracle&nbsp;Corporation</font></a>
<br />
<font size="-2">All&nbsp;rights&nbsp;reserved</font>
</td>
<td valign="bottom" align="right" width="33%">
<table cellspacing="0" cellpadding="0" width="144">
</tr>

<td align="center" valign="top" width="25%"><a href="toc.htm"><img src="../Support/gifs/conticon.gif" alt="Go To Table Of Contents" border="0" height="30" width="30"><br /><font size="-2">Contents</font></a></td>

<td align="center" valign="top" width="25%"><a href="index.htm"><img src="../Support/gifs/indxicon.gif" alt="Go To Index" border="0" height="30" width="30"><br /><font size="-2">Index</font></a></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -