PL/SQL tool to connect to Oracle database remotely
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
② 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.
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.
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.
④ 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.
Create a new SQL window, and then query a SQL statement to see the effect.
⑤ 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;
After configuration, restart PL/SQL and try again.
Like it if you like it ❤!