SQLPlus usually has four connection methods.
sqlplus / as sysdba
Operating system authentication does not require the database server to start listener or the database server to be available. For example, if you want to start the database, you can use this method to access sqlplus and then start it using the startup command. 2.
sqlplus username/password
The listener process of the database server is not required to connect to the local database. However, the database server must be available because the user name and password authentication is required. 3.
sqlplus usernaem/password@orcl
Connect through the network. This requires that the listener of the database server be in the listening state. The procedure for establishing a connection is as follows:. query sqlnet. ora: Check the name resolution method. The default value is TNSNAME B. query tnsnames. ora file, find the orcl record from the inside, and find the database server host name or IP address, port and service_name c. if there is no problem with the listener process on the server, establish a connection with the listener process. D. Depending on different server modes, such as dedicated server mode or shared server mode, listener takes the next action. The default mode is dedicated server. If there is no problem, the client will connect to the server process of the database. E. The connection has been established and you can operate the database. 4.
sqlplus username/password@//host:port/sid
Use sqlplus to remotely connect to oracle commands (for example:
sqlplus risenet/1@//192.168.130.99:1521/risenet
)