Once you are in SQL*Plus, you can connect to another database or change
your connection by using the
CONNECT
command, with this syntax:
CONNECT
<username>/<password>@<connectstring>
The slash separates the username and password. The connect string following
@
is the database alias name. If you omit the password, you will be
prompted to enter it. You may omit the connect string to connect to a local
database.
For DOS and Unix platforms, SQL*Plus comes in character mode. You can
invoke and connect to SQL*Plus using the
sqlplus
command, with this syntax:
sqlplus
username/password@connectstring
If you invoke the tool with just
sqlplus
, you will be prompted for username
and password. If you invoke SQL*Plus with a username, you will be
prompted for a password. Figure 2.2 shows an example of invoking
SQL*Plus from Unix.
Use the
DISCONNECT
command to disconnect your session from the database.
To connect again, use the
CONNECT
command.
SQL> DISCONNECT
Disconnected from Oracle9i Enterprise Edition Release
9.0.1.1.1 -
Production
With the Partitioning option
JServer Release 9.0.1.1.1 - Production
SQL> SELECT * FROM tab;
SP2-0640: Not connected
SQL> CONNECT hr/hr@sql9i
Connected.
SQL>
your connection by using the
CONNECT
command, with this syntax:
CONNECT
<username>/<password>@<connectstring>
The slash separates the username and password. The connect string following
@
is the database alias name. If you omit the password, you will be
prompted to enter it. You may omit the connect string to connect to a local
database.
For DOS and Unix platforms, SQL*Plus comes in character mode. You can
invoke and connect to SQL*Plus using the
sqlplus
command, with this syntax:
sqlplus
username/password@connectstring
If you invoke the tool with just
sqlplus
, you will be prompted for username
and password. If you invoke SQL*Plus with a username, you will be
prompted for a password. Figure 2.2 shows an example of invoking
SQL*Plus from Unix.
Use the
DISCONNECT
command to disconnect your session from the database.
To connect again, use the
CONNECT
command.
SQL> DISCONNECT
Disconnected from Oracle9i Enterprise Edition Release
9.0.1.1.1 -
Production
With the Partitioning option
JServer Release 9.0.1.1.1 - Production
SQL> SELECT * FROM tab;
SP2-0640: Not connected
SQL> CONNECT hr/hr@sql9i
Connected.
SQL>
connect user/password@db_service_name