SQL*Plus User's Guide and Reference Release 9.2 Part Number A90842-01 |
|
This chapter describes the SQL*Plus command-line and iSQL*Plus user interfaces, and the iSQL*Plus Extension for Windows. This chapter contains the following topics:
You can use the command-line interface to SQL*Plus to write SQL*Plus, SQL and PL/SQL commands to:
The SQL*Plus command-line interface is standard on all operating systems. The following shows SQL*Plus running in an X terminal.
Text description of the illustration cmdline.gif
When SQL*Plus starts, it displays the date and time, the SQL*Plus version and copyright information before the SQL*Plus prompt appears. The default prompt for command-line SQL*Plus is:
SQL>
iSQL*Plus is a browser-based interface to Oracle9i. It is a component of the SQL*Plus product.
iSQL*Plus enables you to use a web browser to connect to Oracle9i and perform the same tasks as you would through the command-line version of SQL*Plus.
Different web browsers, and the size of the web browser window, may affect the appearance and layout of iSQL*Plus screens.
There are a number of ways to navigate in iSQL*Plus:
Global navigation icons are displayed on each screen. Icons have three states:
The following icons are displayed in iSQL*Plus screens (including online help):
Logs you out of the iSQL*Plus session and returns you to the Login screen.
Starts a new iSQL*Plus session in a separate web browser window. You can log in to the new session as the same user or as any other valid user.
Opens the iSQL*Plus History screen. You can select one or more previously executed scripts to reload into the Input area or to delete from the History list.
Opens the iSQL*Plus Preferences screen where you can set interface options, system variables or change your password.
Opens the iSQL*Plus Help in a separate web browser window.
Takes you to the next page in iSQL*Plus Help.
Takes you to the previous page in iSQL*Plus Help.
Takes you to the contents in iSQL*Plus Help.
Takes you to the index in iSQL*Plus Help.
Breadcrumbs are navigation links showing the navigation path you have taken. They appear as text links displayed under the iSQL*Plus logo. Click on a breadcrumb link to return to any of the screens listed. For example, navigating to the Preferences screen using the Preferences icon displays a Work screen breadcrumb.
Click the Work Screen link to return to the Work screen.
You connect to the Login screen from your web browser with a URL like:
http://machine_name.domain:port/isqlplus
The Login screen is displayed:
Text description of the illustration loginscn.gif
Enter a valid username to connect to Oracle9i.
Enter a valid password for the username.
Leave this field blank to use the default Oracle database if one exists, otherwise enter an Oracle Net alias to specify a remote database you want to connect to. If you use an Oracle Net alias, it must be defined on the machine running the iSQL*Plus Server, which may not be the same machine from which you run your web browser.
You can also use the full connection identifier, for example:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=www.oracle.com) (PORT=1521)))(CONNECT_DATA=((SERVICE_NAME=orashop.us.acme.com))
iSQL*Plus can be configured to restrict connections to specific databases. If restricted database access has been enabled, a dropdown list of available databases is displayed in place of the Connection Identifier text field. This allows greater security for iSQL*Plus Servers in hosted environments.
Click the Login button to log in to iSQL*Plus with the supplied username, password and connection identifier.
After successfully logging in, the Work screen is displayed.
Text description of the illustration work.gif
Enter the path and filename or the URL of a file you want to load into the Input area for editing or execution.
Click the Browse... button to search for a script file that you want to load for editing or execution. When you select the file, its path and name are entered in the File or URL: field.
Click the Load Script button to load the script specified in the File or URL: field into the iSQL*Plus Input area for editing or execution.
Enter SQL statements, PL/SQL blocks, or iSQL*Plus commands. This area is also referred to as the Input area. You can resize the Input area in the Interface Options screen which you access from the Preferences screen.
Click the Execute button to execute the contents of the Input area. Depending on your preference settings, the results are displayed in the Work screen, in a new web browser window, or saved to a file.
Click the Save Script button to save the contents of the Input area to a file. You are prompted to enter the name of the file. The file extension you choose is for your convenience. It may be useful to identify scripts with an extension of .SQL.
Click the Clear Screen button to clear all statements in the Input area, and all displayed output.
Click the Cancel button to interrupt the script that is currently running.
Click the History icon to display the History screen. The History screen allows you to reload scripts that you have previously executed in the same session.
A History entry is created each time you execute a script in the Work screen if it is not the same as the most recently executed script. The History screen shows the leading 80 characters of the script.
Once you load a script from History, it is moved to the top of the History list, and when the History limit is reached, the earliest scripts are removed. When you exit a session the History is lost, and History is not shared between sessions.
You can change the default number of entries stored in the History list in the Interface Options screen which you access from the Preferences screen.
Text description of the illustration histscn.gif
Shows the current list of scripts in History. They are in most recently executed order, with the most recent at the top. You click the script text to load it into the Input area.
Scripts are displayed verbatim, so be careful if you have included items like CONNECT commands which include passwords.
Loads the selected scripts into the Input area of the Work screen.
Deletes the selected scripts from History.
Cancels the History screen without making further changes or loading a script from History.
The Preferences screen allows you to set interface options and system variables, and to change your password.
Text description of the illustration prefscn.gif
Click Set interface options or the adjacent Go button to access the Interface Options screen. You use the Interface Options screen to set:
See "iSQL*Plus User Interface Options".
Click Set system variables or the adjacent Go button to access the System Variables screen. You use the System Variables screen to set iSQL*Plus system variables. See "Saving Changes to the Database Automatically".
Click Change your password or the adjacent Go button to access the Change Password screen. See "Changing Your Password in iSQL*Plus".
You can click the link or the Go button to navigate to the associated screen.
Click either the OK or the Cancel button to return to the iSQL*Plus Work screen.
In the Interface Options screen, you can set the Input area size, where to output script results and the number of scripts to retain in the History. You access the Interface Options screen from the Preferences screen.
Text description of the illustration option.gif
Enter the width in characters, and the height in lines that you want for the Input area. The default width is 70 characters, and the default height is 10 lines.
Select one of the three options to set the output destination for script results generated from your session:
The Output setting returns to the default of Work screen every time a new session is started.
Enter the number of scripts to be stored in History. The minimum value allowed is zero, the maximum 100, and the default is 10. If you set an invalid value, the previous valid value is used.
You can log in to iSQL*Plus with SYSDBA or SYSOPER privileges to perform database administration and run DBA commands through iSQL*Plus. You must authenticate with the Oracle HTTP Server, and have Oracle SYSDBA or SYSOPER privileges from the Oracle instance.
To connect with either SYSDBA or SYSOPER privileges, your username and password must be added to the Oracle HTTP Server authentication file. See "Enabling DBA Access".
Because of possible HTTP network timeouts, it is recommended that you use command-line SQL*Plus for long running DBA operations.
To log in with SYSDBA or SYSOPER privileges, you must enter the iSQL*Plus DBA URL in the Location/Address field of your web browser. The iSQL*Plus DBA URL is in the form:
http://machine_name.domain:port/isqlplusdba
The following dialog box is displayed prompting you to enter your Oracle HTTP Server authentication username and password.
Text description of the illustration httpauth.gif
Enter a valid Oracle HTTP Server authentication username. This may not be the same as your Oracle9i username.
Enter a valid Oracle HTTP Server authentication password for the username. This may not be the same as your Oracle9i password.
After you have successfully authenticated, the iSQL*Plus DBA Login screen is displayed:
Text description of the illustration lgdbascn.gif
Enter a valid username to connect to Oracle9i.
Enter a valid password for the username. Your password is not displayed, asterisks are displayed for each character entered in the password field.
Leave this field blank to use the default Oracle database if one exists, otherwise enter an Oracle Net connection identifier to specify a remote database you want to connect to. You can use the full connection identifier, for example:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=www.oracle.com) (PORT=1521)))(CONNECT_DATA=((SERVICE_NAME=orashop.us.acme.com))
You can optionally use (INSTANCE_NAME=instance) phrase in place of the (SERVICE_NAME=name) phrase. When connecting to an Oracle8 or earlier database, you use the (SID=name) phrase. Alternatively you can use an Oracle Net alias. If you use an Oracle Net alias, it must be specified on the machine running the iSQL*Plus Server, which may not be the same machine from which you run your web browser.
iSQL*Plus can be configured to restrict connections to specific databases. If restricted database access has been enabled, a dropdown list of available databases is displayed in place of the Connection Identifier text field. This allows greater security for iSQL*Plus Servers in hosted environments.
The Privilege dropdown list has two options:
Click the Login button to log in to iSQL*Plus with the supplied username, password, connection identifier and DBA privilege.
If you log in with SYSDBA or SYSOPER privileges, the iSQL*Plus DBA Work screen is displayed to remind you of the privileged connection.
Fill out the fields on the DBA Work screen as you would for the Work screen.
Text description of the illustration workdba.gif
iSQL*Plus Server statistics provide static environment information as well as dynamic information about iSQL*Plus sessions. The dynamic information may provide useful feedback that can be used for getting the best from the iSQL*Plus Server. For information about Tuning the iSQL*Plus Server, see "Interpreting Active Statistics". You can request a report containing iSQL*Plus Server statistics with:
http://machine_name.domain:port/isqlplusdba?statistics={active|full}
[&refresh=number]
where machine_name.domain is the URL of the Oracle HTTP Server for which you want to generate iSQL*Plus Server statistics.
where port is the port number used by the iSQL*Plus Server.
where ?statistics={active|full}
specifies the level of detail to report.
where
full
gives all possible statistics and is the default.
active
gives dynamically changing session statistics for the iSQL*Plus Server. These statistics are also included at the end of the full report.
where [&refresh=
number]
optionally specifies the time in seconds before the statistics report is automatically refreshed. The minimum value is 10 seconds.
You must have Oracle HTTP Server authentication to access the iSQL*Plus DBA URL, but as there is no connection to a database, no Oracle9i login is required.
The iSQL*Plus Server statistics report has the following sections.
This section displays the following information about the iSQL*Plus Server:
This section shows settings for iSQL*Plus Server environment variables:
This section shows settings for iSQL*Plus Server parameters:
This section shows the type of web browser used by the iSQL*Plus Client (HTTP client).
For information about active statistics, see "iSQL*Plus Server Statistics".
You can set system variables for your iSQL*Plus session in the System Variables screen. You access the System Variables screen from the Preferences screen.
System variable settings return to their default values every time a new session is started.
Text description of the illustration variable.gif
Use the dropdown list to select the system variable you want to set.
Click the Go button to navigate to the Quick link choice.
There are checkboxes, radio buttons and text entry fields as required for each system variable. System variables are listed in alphabetical order.
The current state of system variables is displayed with the exception of the three system variables: CONSTRAINT, ROLE and TRANSACTION. While you can enter and set values for CONSTRAINT, ROLE and TRANSACTION through the associated text fields, the current state is never displayed.
Click the OK button to set all system variables that you have changed.
Click the Cancel button to return to the Preferences screen without making any changes.
iSQL*Plus remembers the state of your current SET command variables from one execution to the next. If you use the Back button on your web browser and then re-execute scripts, or if you re-execute scripts from the History screen, iSQL*Plus may display the results differently, according to any commands executed since the original script was executed. For example, a new SET PAGESIZE command may set column headings to appear in different positions.
The COLUMN command, and the SET LINESIZE and SET WRAP commands have an effect on the buffer sizes used by iSQL*Plus. If words in your script output include unexpected white spaces or are truncated, make sure the column size is large enough to accommodate the word, and that word wrapping is set to ON.
The iSQL*Plus Extension for Windows provides a context menu to load or execute local SQL scripts in iSQL*Plus. The iSQL*Plus Extension for Windows works with .SQL files and is activated by right clicking a .SQL file in Windows Explorer.
The utility is installed during Oracle9i Database and Oracle9i Client for Windows installations. After installation, you can configure access to one or more iSQL*Plus Servers.
After you have configured an iSQL*Plus Server, you can use the context menu to:
The following shows a typical view of the context menu with iSQL*Plus Servers configured.
Text description of the illustration isenew.gif
The highlighted iSQL*Plus Server is configured to start iSQL*Plus in a browser and load MIS_Reports.sql into the Input area of the iSQL*Plus Server named Employee_LA.
For information about configuring iSQL*Plus Servers in the iSQL*Plus Extension, see "iSQL*Plus Extension for Windows Configuration".
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|