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

📄 ch3_sql.htm

📁 Debian中文参考手册,系统介绍了Debian系统
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE html
   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//en"
   "http://www.w3c.org/TR/1999/PR-xhtml1-19991210/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" sml:lang="en" lang="en">
<head>

<!-- Run date = May 1, 2002 19:19:1 -->
<meta name="XHTML Generator" content="Oracle SGML to XHTML converter - Version 3.1.2">
<title> Administering SQL&#042;Plus and iSQL&#042;Plus </title>
<link rel="next" href="ch4_comp.htm" title="Next">
</head>
<body bgcolor="#ffffff">
<a id="top" name="top"></a>
<a href="#BEGIN">Skip Headers</a><br><br>
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="left" valign="top"><font face="helvetica, arial, sans-serif">
<b>Oracle9<em>i</em> Administrator's Reference  </b>
<br />
<b>Release 2 (9.2.0.1.0) for UNIX Systems: AIX-Based Systems, Compaq Tru64 UNIX, HP 9000 Series HP-UX, Linux Intel, and Sun Solaris</b>
<br />
Part No. A97297-01
</font>
</td>
<td valign="bottom" align="right" width="144">
<table cellspacing="0" cellpadding="0" width="100%">
</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>
<hr />
<p>
<a href="ch2_tun.htm">
<img src="../Support/gifs/larrow.gif" alt="Previous" border="0" height="30" width="30"></a>
<a href="ch4_comp.htm">
<img src="../Support/gifs/rarrow.gif" alt="Next" border="0" height="30" width="30"></a>
</p>
<a name="BEGIN"></a>
<div class="IND">
<!-- End Header --><a id="CHDJCHJI" name="CHDJCHJI"></a><a id="i8440" name="i8440"></a>
<h1>
<font face="arial, helvetica, sans-serif" color="#330099">
3
<br />
 Administering SQL&#042;Plus and <em>i</em>SQL&#042;Plus 
</font>
</h1>
<p>This chapter describes how to use and administer SQL&#042;Plus and <em>i</em>SQL&#042;Plus on Oracle9<em>i</em>. It contains the following sections:
</p>
<ul>
<li type="disc">
<p><a href="#i4981">Administering Command-Line SQL&#042;Plus</a>
</p>
</li>
<li type="disc">
<p><a href="#CHDECGID">Administering <em>i</em>SQL&#042;Plus</a>
</p>
</li>
<li type="disc">
<p><a href="#i2833">Using Command-Line SQL&#042;Plus</a>
</p>
</li>
<li type="disc">
<p><a href="#i9455">SQL&#042;Plus Restrictions</a>
</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>See Also:</strong>
</font>
</p><em>SQL&#042;Plus Users Guide and Reference</em> for more information on <em>i</em>SQL&#042;Plus and SQL&#042;Plus.
</td>
</tr></tbody>
</table><br />
</div>
</li>
</ul><a id="i4981" name="i4981"></a>
<div class="sect1">
<!--
infolevel=all
infotype=general
--><a id="sthref395" name="sthref395"></a>
<h2>
<font face="arial, helvetica, sans-serif" color="#330099">Administering Command-Line SQL&#042;Plus<a id="sthref396" name="sthref396"></a>
</font>
</h2>
<p>This section describes how to administer command-line SQL&#042;Plus. In the examples in this section, SQL&#042;Plus uses the value of the ORACLE&#095;HOME environment variable wherever a question mark (<code>?</code>) appears.
</p>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref397" name="sthref397"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Using Setup Files<a id="sthref398" name="sthref398"></a><a id="sthref399" name="sthref399"></a>
</font>
</h3>
<p>When you start SQL&#042;Plus, it executes the <code>glogin.sql</code> site profile set-up file and then executes the <code>login.sql</code> user profile set-up file. 
</p>
<div class="sect3">
<!--
infolevel=all
infotype=general
--><a id="sthref400" name="sthref400"></a>
<h4>
<font face="arial, helvetica, sans-serif" color="#330099">
Using the Site Profile<a id="sthref401" name="sthref401"></a><a id="sthref402" name="sthref402"></a> File
</font>
</h4>
<p>The global site profile file is <code>&#036;ORACLE&#095;HOME&#047;sqlplus&#047;admin&#047;glogin.sql</code>. If a site profile already exists at this location, it is overwritten when you install SQL&#042;Plus. If SQL&#042;Plus is removed, the site profile file is deleted.
</p>
</div class="sect3">
<div class="sect3">
<!--
infolevel=all
infotype=general
--><a id="sthref403" name="sthref403"></a>
<h4>
<font face="arial, helvetica, sans-serif" color="#330099">
Using the User Profile<a id="sthref404" name="sthref404"></a><a id="sthref405" name="sthref405"></a><a id="sthref406" name="sthref406"></a> File
</font>
</h4>
<p>The user profile file is <code>login.sql</code>. SQL&#042;Plus looks for this file in the current directory, and then in the directories you specify using the SQLPATH environment variable. Set this environment variable to a colon-separated list of directories. SQL&#042;Plus searches these directories for the <code>login.sql</code> file in the order they are listed. 
</p>
<p>The options set in the <code>login.sql</code> file override those set in the <code>glogin.sql</code> file.
</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><em>SQL&#042;Plus User&#039;s Guide and Reference</em> for more information on profile files.
</td>
</tr></tbody>
</table><br />
</div>
</div class="sect3">
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref407" name="sthref407"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Using the PRODUCT&#095;USER&#095;PROFILE Table<a id="sthref408" name="sthref408"></a><a id="sthref409" name="sthref409"></a>
</font>
</h3>
<p>Oracle9<em>i</em> provides the PRODUCT&#095;USER&#095;PROFILE table that you can use to disable the SQL and SQL&#042;Plus commands that you specify. This table is created automatically when you choose an installation type that installs a starter database. A started database is not installed, and demonstration tables are not created, in the following circumstances:
</p>
<ul>
<li type="disc">
<p>If you select the Software Only database configuration option
</p>
</li>
<li type="disc">
<p>If you do not select the Demo Schemas option during a Custom installation
</p>
</li>
</ul>
<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><em>Oracle9i Installation Guide Release 2 (9.2.0.1.0) for UNIX Systems</em> for information on installation options.
</td>
</tr></tbody>
</table><br />
<p>To recreate the PRODUCT&#095;USER&#095;PROFILE table, run the <code>&#036;ORACLE&#095;HOME&#047;sqlplus&#047;admin&#047;pupbld.sql</code> script in the SYSTEM schema:
</p>
<pre>&#036;<em>ORACLE&#095;HOME</em>&#047;sqlplus&#047;admin&#047;pupbld.sql

</pre>
<p>For example, enter the following commands, where <em><code>SYSTEM&#095;PASSWORD</code></em> is the password of the SYSTEM user:
</p>
<pre>&#036; sqlplus SYSTEM&#047;<em>SYSTEM&#095;PASSWORD</em>
SQL&gt; &#064;?&#047;sqlplus&#047;admin&#047;pupbld.sql

</pre>
<p>You can also recreate the PRODUCT&#095;USER&#095;PROFILE table manually in the SYSTEM schema using the <code>&#036;ORACLE&#095;HOME&#047;bin&#047;pupbld</code> shell script. This script prompts for the SYSTEM password. If you need to run the <code>pupbld</code> script without interaction, set the SYSTEM&#095;PASS environment variable to the SYSTEM username and password. For example, enter the following command where <em><code>SYSTEM&#095;PASSWORD</code></em> is the password of the SYSTEM user:
</p>
<pre>&#036; SYSTEM&#095;PASS&#061;SYSTEM&#047;<em><code>SYSTEM&#095;PASSWORD</code></em>; export SYSTEM&#095;PASS

</pre>
</div class="sect2"><a id="i2869" name="i2869"></a>
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref410" name="sthref410"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Using Demonstration Tables<a id="sthref411" name="sthref411"></a><a id="sthref412" name="sthref412"></a>
</font>
</h3>
<p>Oracle9<em>i</em> provides demonstration tables that you can use for testing. These demonstration tables are created automatically when you choose an installation type that installs a starter database. A started database is not installed, and demonstration tables are not created, in the following circumstances:
</p>
<ul>
<li type="disc">
<p>If you select the Software Only database configuration option
</p>
</li>
<li type="disc">
<p>If you do not select the Demo Schemas option during a Custom installation
</p>
</li>
</ul>
<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>See Also:</strong>
</font>
</p><em>Oracle9i Sample Schemas</em> guide for information on demonstration tables and the <em>Oracle9i Installation Guide Release 2 (9.2.0.1.0) for UNIX Systems</em> for information on installation options.
</td>
</tr></tbody>
</table><br />
</div>
</div class="sect2">
<div class="sect2"><a id="sthref413" name="sthref413"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
Using EMP and DEPT Tables
</font>
</h3>
<p>This section describes how to manually create and delete the EMP and DEPT demonstration tables.
</p>
<div class="sect3">
<!--
infolevel=all
infotype=general
--><a id="sthref414" name="sthref414"></a>
<h4>
<font face="arial, helvetica, sans-serif" color="#330099">
Creating Demonstration Tables Manually<a id="sthref415" name="sthref415"></a>
</font>
</h4>
<p>Use the <code>&#036;ORACLE&#095;HOME&#047;sqlplus&#047;demo&#047;demobld.sql</code> SQL script to create the EMP and DEPT demonstration tables. In SQL&#042;Plus, you can use any username to run the <code>demobld.sql</code> script to create the demonstration tables in a schema. For example, enter: 
</p>
<pre>&#036; sqlplus SCOTT&#047;TIGER 
SQL&gt; &#064;?&#047;sqlplus&#047;demo&#047;demobld.sql

</pre>
<p>You can also use the <code>&#036;ORACLE&#095;HOME&#047;bin&#047;demobld</code> shell script to run the <code>demobld.sql</code> script, as follows:
</p>
<pre>&#036; demobld SCOTT TIGER

</pre>
</div class="sect3">
<div class="sect3">
<!--
infolevel=all
infotype=general
--><a id="sthref416" name="sthref416"></a>
<h4>
<font face="arial, helvetica, sans-serif" color="#330099">
Deleting Demonstration Tables<a id="sthref417" name="sthref417"></a>
</font>
</h4>
<p>Use the <code>&#036;ORACLE&#095;HOME&#047;sqlplus&#047;demo&#047;demodrop.sql</code> script to drop the EMP and DEPT demonstration tables. In SQL&#042;Plus, you can use any username to drop the demonstration tables from the user&#039;s schema. For example, enter: 
</p>
<pre>&#036; sqlplus SCOTT&#047;TIGER 
SQL&gt; &#064;?&#047;sqlplus&#047;demo&#047;demodrop.sql

</pre>
<p>You can also use the <code>&#036;ORACLE&#095;HOME&#047;bin&#047;demodrop</code> shell script to run the <code>demodrop.sql</code> script, as follows:
</p>
<pre>&#036; demodrop SCOTT TIGER

</pre>
</div class="sect3">
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref418" name="sthref418"></a>
<h3>
<font face="arial, helvetica, sans-serif" color="#330099">
SQL&#042;Plus Command-Line Help<a id="sthref419" name="sthref419"></a>
</font>
</h3>
<p>This section describes how to install and remove the SQL&#042;Plus command-line help. 
</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><em>SQL&#042;Plus User&#039;s Guide and Reference</em> for more information on the SQL&#042;Plus command-line help.
</td>
</tr></tbody>
</table><br />
</div>
</div class="sect2">
<div class="sect2">
<!--
infolevel=all
infotype=general
--><a id="sthref420" name="sthref420"></a>
<h3>

⌨️ 快捷键说明

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