SQL Plus - Connect

> Procedural Languages > (SQL Plus|SqlCl) (Oracle Database Console)

1 - About

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

Advertising

3 - Syntax

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

where:

4 - 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@'[email protected]"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" 
Advertising
lang/sqlplus/connect.txt · Last modified: 2017/09/06 19:29 by gerardnico