SQL*Plus User's Guide and Reference
Release 8.1.5

A66736-01

Library

Product

Contents

Index

Prev Up Next

Command Reference, 16 of 52


CONNECT

Purpose

Connects a given username to Oracle.

Syntax

CONN[ECT]  [[logon] [AS [SYSOPER|SYSDBA]]]

where logon requires the following syntax:

username[/password][@net_service_name]|/

Terms and Clauses

Refer to the following list for a description of each term or clause:

username[/password]

      Represent the username and password with which you wish to connect to Oracle. If you omit username and password, SQL*Plus prompts you for them. If you enter a slash (/) or simply enter [Return] to the prompt for username, SQL*Plus logs you in using a default logon (see "/" below).

      If you omit only password, SQL*Plus prompts you for password. When prompting, SQL*Plus does not display password on your terminal screen. See the PASSWORD command in this chapter for information about changing your password.

net_service_name

      Consists of a Net8 connection string. The exact syntax depends upon the Net8 communications protocol your Oracle installation uses. For more information, refer to the Net8 manual appropriate for your protocol or contact your DBA. SQL*Plus does not prompt for a service name, but uses your default database if you do not include a specification.

/

      Represents a default logon using operating system authentication. You cannot enter a net_service_name if you use a default logon. In a default logon, SQL*Plus typically attempts to log you in using the username OPS$name, where name is your operating system username. See the Oracle8i Administrator's Guide for information about operating system authentication.

AS [SYSOPER|SYSDBA]

      The AS clause allows privileged connections by users who have been granted SYSOPER or SYSDBA system privileges.

Usage Notes

CONNECT commits the current transaction to the database, disconnects the current username from Oracle, and reconnects with the specified username.

If you log on or connect as a user whose account has expired, SQL*Plus prompts you to change your password before you can connect.

If an account is locked, a message is displayed and connection into that account (as that user) is not permitted until the account is unlocked by your DBA.

For more information about user account management, refer to the CREATE and ALTER USER commands, and the CREATE PROFILE command in the Oracle8i SQL Reference.

Examples

To connect across Net8 using username SCOTT and password TIGER to the database known by the Net8 alias as FLEETDB, enter

SQL> CONNECT SCOTT/TIGER@FLEETDB

To connect using username SCOTT, letting SQL*Plus prompt you for the password, enter

SQL> CONNECT SCOTT

For more information about setting up your password file, refer to the Oracle8i Administrator's Guide.

To use a password file to connect to an instance on the current node as a privileged user named SCOTT with the password TIGER, enter

SQL> CONNECT SCOTT/TIGER AS SYSDBA

Note, that your default schema is now SYS, not SCOTT.


Prev Up Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index