SQL*Plus is "the command-line interface to the Oracle database." It is a tool used to query tables and views. SQL*Plus includes formatting commands that allow you to format query results "so that you can print them and produce a credible-looking report."[4]

This section aims to cover some basic SQL*Plus commands. For additional information about SQL*Plus, please refer to the book Oracle SQL*Plus by Jonathan Gennick and Joyce Warren’s Oracle/SQL Tutorial.

To start SQL*Plus:
click on Start|Programs|Oracle for Windows 95|SQL Plus 8.0.
In the Log On screen, type the user name and password. (For example, you can access SQL*Plus with user SAM with a password of SAM.) Then click okay. If the database is not already started, it will start automatically once you log on to SQL*Plus.

All SQL*Plus commands are not case sensitive. The commands in this module are shown in uppercase to make them stand out from the text.

CONNECT

DESCRIBE

PASSWORD

SHOW USER

EXIT



CONNECT

The CONNECT command allows you to log on as a different user, or log on to a different database. The syntax for the CONNECT command is:

CONNECT [username[/password][@database] [AS {SYSOPER|SYSDBA}]|[INTERNAL]

The different parts of the command are explained here:

CONN[ECT] - May be abbreviated CONN.
username - Is your username.
password - Is your password.
@database - Connects you to the named database.
AS - "Tells SQL*Plus that you are connecting in an administrative role."[4]
SYSOPER - "Tells SQL*Plus that you are connecting as an operator."[4]
SYSDBA - "Tells SQL*Plus that you are connecting as a database administrator."[4]
INTERNAL - "Tells SQL*Plus that you want to connect internally."[4]

"The SYSOPER role was created for computer operators, who, in the absence of a database administrator, may need to perform such tasks as starting, stopping, and backing up the database."[4]
Back to CONNECT command

"The SYSDBA role is intended for database administrators. There are no restrictions on what a user with SYSDBA can do."[4]
Back to CONNECT command

You can connect as INTERNAL as another option for peforming database administration duties. This option was created for backwards compatibility with previous versions of Oracle and normally should not be used.[4]
Back to CONNECT command

Back to Top


DESCRIBE

You can use the DESCRIBE command to view column definitions for a table. This command lists the following three things for each column in the table:

  • The column's name
  • The column's datatype and length
  • Whether the column can be null or not

Back to Top


PASSWORD

The PASSWORD command lets you change your database password. The syntax for the PASSWORD command is:

PASSWORD [username]

The different parts of the command are explained here:

PASS[WORD] - May be abbreviated PASSW
username - "Is the username whose password you want to change. Usually only database administrator's can change passwords for other users. You do not need to supply a username if you are changing your own password."[4]

Back to Top


SHOW USER

The SHOW USER command shows the username of the user who is currently logged in to the database. Here is an example of how the SHOW USER command works:

SQL>show user
user is "SYSTEM"
SQL>

Back to Top


EXIT

The EXIT command terminates the SQL*Plus session and closes the SQL*Plus window. The syntax for the EXIT command is simply EXIT.

Back to Top


Return To Main