Oracle入门(五A)之conn命令

一、connect命令

    将给定的用户名连接到Oracle数据库。当你运行一个连接命令、站点配置文件、Galgn.SQL和用户配置文件,按顺序处理Login .SQL。连接不重发如果初始连接不成功,请使用用户名或密码。


语法: conn[ect]    [{登录串|/|代理串}   [AS {SYSOPER|SYSDBA|SYSASM}]    [edition=value]]

a.登录串:用户名[/密码][@连接字符串]

b.代理串:代理用户[用户名][/密码][@连接字符串]   

     注意:代理中用户名的括号是必需的语法。

c.连接字符串: ip地址[:端口号(默认端口1521)]/数据库名

d.conn是connect的缩写


如,代理用户

conn myOrcale[sys]/[email protected]:1521/orcl as sysdba

如,普通用户

SQL>conn user/abc

如,超级管理员

SQL>conn sys/abcd as sysdba

或者

SQL> connect / as sysdba 

如,超级管理员远程登录

SQL>conn sys/[email protected]:1521/orcl as sysdba

二、英文版

SQL> help conn
 CONNECT
 -------
 Connects a given username to the Oracle Database. When you run a
 CONNECT command, the site profile, glogin.sql, and the user profile,
 login.sql, are processed in that order. CONNECT does not reprompt
 for username or password if the initial connection does not succeed.

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

 where logon has the following syntax:
     username[/password][@connect_identifier]

 where proxy has the syntax:
     proxyuser[username][/password][@connect_identifier]
 NOTE: Brackets around username in proxy are required syntax

你可能感兴趣的:(Oracle)