PL/SQL tool remotely connect to Oracle database method, plsql directly configure oci without installing oracle client

For the installation of PL/SQL tools, please refer to my article: Download, installation and use of
PL/SQL database connection tools, activation of PL/SQL tools

Chapter 1: PL/SQL Tool Configuration

① oci download

There is no need to install the entire oracle database to use oci , oci is equivalent to a lightweight client. Obtain the address: oracle install client official download According to the download version of the database to be remote, this must be consistent with the number of database bits, otherwise it cannot be used.

select * from v$version

Insert picture description here

Insert picture description here
Insert picture description here
Insert picture description here

② oci configuration

After the downloaded tool is decompressed, add the network folder in the root directory, add the admin folder, and then create a new tnsnames.ora file.
Insert picture description here
tnsnames.ora file add the following configuration information:
where [10.10.xx.xx] / orcl to connect to the database as a remote I said that such a name for easy identification, the name can be easily defined.

Insert picture description here
The specific configuration information is as follows:

[10.10.xx.xx]/orcl =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.xx.xx)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

③ PL/SQL tool configuration

In configure the preferenes configured, the configuration of our oci information.

Insert picture description here

④ PL/SQL remote connection to Oracle database demonstration

After configuration, restart PL/SQL and you can use it. You can see that the database can refer to our configuration database information.
Insert picture description here
Create a new SQL window, and then query a SQL statement to see the effect.

Insert picture description here

⑤ The connection fails, configure environment variables to solve the problem

You can try to match the environment, first check the database language we want to connect to.

select userenv('language') from dual;

Insert picture description here
Insert picture description here
Insert picture description here
After configuration, restart PL/SQL and try again.
Like it if you like it ❤!

Guess you like

Origin blog.csdn.net/qq_38161040/article/details/108170206