sqlplus command to log in to Oracle

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)
      Insert picture description here
    • Method 2: Through cmd window ( 即使忘记了密码,也可以登录)
      Insert picture description here

2 Three login methods

方式1> sqlplus / as sysdba

方式2> sqlplus username/password@ip:port/sid
> sqlplus username/password@orcl -- 简写(前提:配置了 TNS),以下同

方式3:(推荐)
> sqlplus /nolog
> conn username/password@ip:port/sid
  • If “TNS monitor” is configured , there is also a shorthand method

Insert picture description here

2.1 sqlplus / as sysdba

> sqlplus / as sysdba

Insert picture description here

2.2 sqlplus username/password@ip:port/sid

> sqlplus scott/scott@orcl -- 简写
>
> sqlplus username/password@ip:port/sid -- 全称

Insert picture description here

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

Insert picture description here

3 Alternative commands

> exit 退出
> ho cls 清屏

Guess you like

Origin blog.csdn.net/qq_34745941/article/details/108647953