Home Oracle Commands

CONNECT

Start a user session.

Syntax:

Connecting from an SQL Prompt:

   CONNECT "username"
   CONNECT "username/password"
   CONNECT "username/password@connect_string"
   CONNECT "username/password@connect_string AS SYSDBA"
   CONNECT / AS SYSDBA

Starting SQL*Plus:

   SQLPLUS  [option] "<username>" [<start>]
   SQLPLUS  [option] "username/password" [<start>]
   SQLPLUS  [option] "username/password@connect_string" [<start>]
   SQLPLUS  [option] "username/password@connect_string AS SYSDBA" [<start>]
   SQLPLUS                     -- Interactive logon
   SQLPLUS /NOLOG [<start>]    -- Don't login to a database
   SQLPLUS -H                  -- Display SQL*Plus Help
   SQLPLUS -V                  -- Display SQL*Plus version

  Options
     "-L"      Attempt log on just once
     "-M <o>"  Use HTML markup options <o>
     "-R <n>"  Use restricted mode <n>
     "-S"      Use silent mode
     /         Login without using TNS (i.e on the server) ORACLE_SID
     /NOLOG    Don't login to a database

  <start>  ::=
      @<filename>[.<ext>] [<parameter> ...]
      @<URI>

Notes
CONNECT can be abbreviated as CONN. 
To connect as System Operator rather than DBA, replace SYSDBA with SYSOPER in the syntax above.
CONNECT INTERNAL is no longer a valid login option (deprecated in 8.0, abolished in 9i.)

Examples
  sqlplus "system/manager@ss64.com"
  Connected
  SQL> show user 
USER is "SYSTEM" sqlplus "sys/manager@ss64.com AS SYSDBA" Connected SQL> show user
USER is "SYS" -- To connect without using TNS (on the server) set oracle_sid=test sqlplus "sys/manager as sysdba"

"Everything is connected to everything else" - Barry Commoner (Three laws of Ecology)

Related Commands:

COMMIT
DISCONNECT
ROLLBACK
ALTER SYSTEM ENABLE RESTRICTED SESSION
SET TRANSACTION

Related Views:

 DBA_PENDING_TRANSACTIONS
                                           USER_RESOURCE_LIMITS
 V$SESSION
 V$SESSION_CONNECT_INFO
 V$SESSION_CURSOR_CACHE
 V$SESSION_EVENT
 V$SESSION_LONGOPS
 V$SESSION_OBJECT_CACHE
 V$SESSION_WAIT
 V$SESSTAT
 V$SESS_IO



Back to the Top

Simon Sheppard
SS64.com