Table of Contents

About

CONNECT is a SQLPlus command that permits to make a connection as a user with a database (instance of).

Syntax

CONN[ECT] [{logon|/|proxy}
[AS {SYSASM|SYSBACKUP|SYSDBA|SYSDG|SYSOPER|SYSRAC|SYSKM}]
[edition=value]]

where:

  • logon has the following syntax: username/password@connect_identifier
  • proxy has the syntax: proxyuser[username]/password@connect_identifier
  • {SYSASM|SYSBACKUP|SYSDBA|SYSDG|SYSOPER|SYSRAC|SYSKM} are the database privilege
  • edition specify the database edition to use (same effect than the ORA_EDITION environment variable)

Example

Connect identifiers used in a connect string cannot contain spaces, unless enclosed within single quotes (') or double quotes (“). In the following examples, a connect identifier and a connect descriptor that contain spaces are enclosed within single quotes:

CONNECT scott/tiger@'(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)
(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=sales.us.acme.com)))'
CONNECT scott/tiger@'cn=sales, cn=OracleContext, dc=us, dc=acme, dc=com'

Single quotes (') are required if a double quote (”) is used in a connect identifier. For example:

CONNECT scott/tiger@'sales@Good"Fast"Food.com' 

Likewise, double quotes (“) are required if a single quote (') is used in a connect identifier. For example:

CONNECT scott/tiger@"cn=sales, cn=OracleContext, ou=Mary's Dept, o=acme"