| Oracle9i Administrator's Reference Release 1 (9.0.1) for Alpha OpenVMS Part Number A90868-01 |
|
This chapter describes how to use and administer SQL*Plus on Oracle9i.
This chapter contains the following topics:
This section describes how to administer SQL*Plus.
When you start SQL*Plus, it executes the glogin.sql site profile set-up file and then executes the login.sql user profile set-up file.
The global site profile file is $ora_sqlplus:glogin.sql. If a site profile already exists at this location, it is overwritten when you install SQL*Plus. If SQL*Plus is removed, the site profile file is deleted.
The user profile file is login.sql. SQL*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 comma-separated list of directories. For example,
define SQLPATH "Disk1:[Path1],Disk2:[Path2]"
SQL*Plus searches these directories for the login.sql file in the order they are listed.
The options set in the login.sql file override those set in the glogin.sql file.
During a Typical installation, the PRODUCT_USER_PROFILE table is created automatically. This table is used to disable the SQL and SQL*Plus commands you specify. To recreate this table, run the ora_sqlplus_demo:pupbld.sql
script in the SYSTEM schema.
For example, enter:
$ sqlplus SYSTEM/MANAGER SQL> @ora_sqlplus_demo:pupbld.sql
SQL*Plus is shipped with demonstration tables that you can use for testing.
During a Typical installation, the user SCOTT and the demonstration tables are created automatically.
Use the ora_sqlplus_demo:demobld.sql SQL script to create the demonstration tables. In SQL*Plus, you can use any user name to run the demobld.sql file to create the demonstration tables in a schema. For example, enter:
$ SQLplus system/manager SQL> @ora_sqlplus_demo:demobld.sql
Use the ora_sqlplus_demo:demodrop.sql script to drop the demonstration tables. In SQL*Plus, you can use any user name to drop the demonstration tables in the user's schema. For example, enter:
$ sqlplus scott/tiger SQL> @ora_sqlplus_demo:demodrop.sql
This section describes how to install and remove the SQL*Plus online help.
There are four ways to install the SQL*Plus online help:
When you copy a starter database with pre-built data files as part of the Typical installation, SQL*Plus automatically installs the SQL*Plus online help.
You can use the Oracle Database Configuration Assistant to create help tables when creating a database.
helpbld.sql SQL script
You can use the ora_sqlplus_demo:helpbld.sql script with the helpus.sql script to manually install the online help. For example, enter:
$ set def ORA_sqlplus_demo
$ define/job system_pass "system/manager"
SQL>@hlpbld.sql ora_sqlplus:helpus.sql
You can also run the ora_sqlplus:helpdrop.sql in SQL*Plus to manually drop the online help tables in a schema. For example, enter:
$ sqlplus SYSTEM/MANAGER SQL> @ora_sqlplus:helpdrop.sql
This section describes how to use SQL*Plus on Alpha OpenVMS systems.
If you enter an ED or EDIT command at the SQL*Plus prompt, the system starts an operating system editor, such as edit or EDT. Your PATH variable must include the directory where the editor executable is located.
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*Plus.
You can specify which editor starts by defining the SQL*Plus _EDITOR variable. You can define this variable in the glogin.sql site profile, the login.sql user profile, or define it during the SQL*Plus session. For example, to set the default editor to EDT, enter:
SQL> DEFINE _EDITOR=EDT
If you do not set the _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 value is used. When _EDITOR, EDITOR, and VISUAL are not specified, the default editor is ed.
If you start the editor, SQL*Plus uses the afiedt.buf temporary file to pass text to the editor. You can use the SET EDITFILE command to specify a different file name. For example, enter:
SQL> SET EDITFILE /test15:[tmp]myfile.sql
SQL*Plus does not delete the temporary file.
Using the HOST command or a dollar sign ($) as the first character after the SQL*Plus prompt causes subsequent characters to be passed to a sub-shell.
To return to SQL*Plus, enter LOGOUT.
For example, to enter one command, enter:
SQL> Host or $
In the preceding example, Host represents the operating system command you want to execute.
To enter multiple operating system commands from SQL*Plus, enter the Host or $ command, and press return. SQL*Plus returns you to the operating system prompt.
While running SQL*Plus, you can stop the scrolling record display and terminate a SQL statement by pressing [Ctrl]+[c].
The default file extension of files generated by the SPOOL command is .lis. To change this extension, specify a spool file containing a period (.). For example, enter:
SQL> SPOOL query.txt
This section describes SQL*Plus restrictions.
The default values for SQL*Plus LINESIZE and PAGESIZE do not automatically adjust for window size.
OpenVMS return codes use only one byte, that is not enough space to return an Oracle error code. The range for a return code is 0 to 255.
|
|
![]() Copyright © 2001 Oracle Corporation. All Rights Reserved. |
|