1 Overview
- sql*plus There are two ways to log in to the Oracle database through the command line
- Method 1: Through the sql*plus command window (when downloading Oracle, it comes with it)
- Method 2: Through cmd window (
即使忘记了密码,也可以登录
)
2 Three login methods
方式1:
> sqlplus / as sysdba
方式2:
> sqlplus username/password@ip:port/sid
> sqlplus username/password@orcl
方式3:(推荐)
> sqlplus /nolog
> conn username/password@ip:port/sid
- If “TNS monitor” is configured , there is also a shorthand method
2.1 sqlplus / as sysdba
> sqlplus / as sysdba
2.2 sqlplus username/password@ip:port/sid
> sqlplus scott/scott@orcl
>
> sqlplus username/password@ip:port/sid
2.3 sqlplus /nolog
- First with no log of the log, temporarily connect database
- Benefits: Avoid logged on user name, password disclosure
> sqlplus /nolog
> conn scott/scott@orcl
3 Alternative commands
> exit 退出
> ho cls 清屏