对于经常在SQL*Plus 下工作的大师们而言,总是时不时查询SQL*Plus的帮助命令。着实太多了,记不住。SQL*Plus下直接提供了help命令来帮助描述所有命令的用法。嘎嘎,再也不用查SQL*Plus reference了。对于Oracle 10g缺省情况下,SQL*Plus的help手册并没有被安装,需要手动安装。Oracle 10/11g下采用相同的安装方式,下面来描述一下help的安装与使用。
1、安装sqlplus help
system@CNMMBO> help
SP2-0171: HELP system not available.
robin@SZDB:~> cd $ORACLE_HOME/sqlplus/admin/help --脚本路径位于ORACLE_HOME,sqlplus/admin/hlep目录下
robin@SZDB:/users/oracle/OraHome10g/sqlplus/admin/help> ls
helpbld.sql helpdrop.sql helpus.sql hlpbld.sql
robin@SZDB:/users/oracle/OraHome10g/sqlplus/admin/help> head -40 hlpbld.sql
--
-- Copyright (c) Oracle Corporation 1983, 2003. All Rights Reserved.
--
-- NAME
-- hlpbld.sql
--
-- DESCRIPTION
-- Builds the SQL*Plus HELP table and loads the HELP data from a
-- data file. The data file must exist before this script is run.
--
-- USAGE
-- To run this script, connect as SYSTEM and pass the datafile to be
-- loaded as a parameter e.g.
--
-- sqlplus system/ @hlpbld.sql helpus.sql
--
--
DEFINE DATAFILE = &1
--
-- Create the HELP table
--
DROP TABLE HELP;
CREATE TABLE HELP
(
TOPIC VARCHAR2 (50) NOT NULL,
SEQ NUMBER NOT NULL,
INFO VARCHAR2 (80)
) PCTFREE 0 STORAGE (INITIAL 48K PCTINCREASE 0);
GRANT SELECT ON HELP TO PUBLIC;
--
-- Insert the data into HELP.
--
@@&DATAFILE
system@CNMMBO> @$ORACLE_HOME/sqlplus/admin/help/hlpbld.sql helpus.sql
DROP TABLE HELP
*
ERROR at line 1:
ORA-00942: table or view does not exist
Table created.
Grant succeeded.
...
Commit complete.
View dropped.