Oracle Database Connection through SQLPLUS

I am trying to connect to my Oracle database from SQLPlus, but I cannot connect.

I have an Oracle client (10g) on ​​my machine. Listed below are the details with which I can connect to my Java application.

connect('dbi:Oracle://IP/wborcle', 'username', 'pwd'));

What will be the hoststring when connecting through SQLPLUS?

+4
source share
5 answers

Oracle offers several different methods for finding databases when you try to connect to them:

  • tnsnames.ora entries
  • LDAP
  • Ezconnect
  • ...

The most common approach is to include the databases you are connecting to in tnsnames.ora; usually your client installation contains a tnsnames.ora file that you can modify.

- EZConnect. EZConnect

<username>/<password>@<hostname>:<port>/SID

() -

sqlplus scott/tiger@localhost:1521/wborcle

+6

Try

sqlplus username/password@host:port/service

sqlplus system/system@localhost:1521/xe

https://dba.stackexchange.com/questions/65032/connect-to-sql-plus-from-command-line-using-connection-string

+5
 sqlplus user/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=hostname.network)(Port=1521))(CONNECT_DATA=(SID=remote_SID)))

, , , , -

sqlplus "user/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=hostname.network)(Port=1521))(CONNECT_DATA=(SID=remote_SID)))"

 sqlplus 'user/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=hostname.network)(Port=1521))(CONNECT_DATA=(SID=remote_SID)))'
+1
sqlplus username/password@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=hostname)(Port=1521))(CONNECT_DATA=(SID=sidname)))
+1

If you are using the standard client, to use the ezconnect syntax, you may need to install it in the sqlnet.ora file, in the network / admin directory of the client

names.directory_path = (TNSNAMES, ezconnect)

0
source

Source: https://habr.com/ru/post/1530223/


All Articles